5E 2004.06.17
1. UNIX
1.1 ( 1 )
D1 D9
* D8 (
) D3 f1
(1) (2)
1.2 ( 1 )
(1) (2) (3)
1.3 ( 1 )
( 1 ) (1)
(2)
(3)
(4) hoge
(5)
(6) hoge
(7) hoge
(8) hoge
(9) hoge
(10) hoge
huga
1.4 (1:3 2: 2 )
(1) C
(2) C test.c
testrun
[ ] test.c [ ] test.c
2. C
2.1 ( 3 )
(1) ( )
(2)
2.2 (1:3 2: 2 3: 2 ) (1)
(2) [ ] [ ]
#include <stdio.h>
double func(double a);
double x;
/* --- main ---*/
int main(){
double y,theta;
theta=3.1415924/6.0;
y=func(theta);
printf("%lf\t%lf\t%lf\n",theta,x,y);
return(0);
}
/* --- func ---*/
double func(double a){
double b;
b = sin(a);
return(b);
}
(3) 1
[ ] aa bb
[ ] i j k l m
[ ] A E F
2.3 ( 3 )
(1) 2
if
≤i 100
y=sin(x)
i=1
<100 i
y=cos(x)
i=−1
(2) for 1 100
sum
#include <stdio.h>
int main(){
int i,sum;
sum=0;
printf("sum=%d\n",sum);
return(0);
}
(2) while 1 100
sum
#include <stdio.h>
int main(){
int i,sum;
sum=0;
i=1;
printf("sum=%d\n",sum);
return(0);
}
2.4 (1:3 2: 2 ) (1)
(2) C
1
[ ] 2
0 100 0 100
[ ] 3
0 10 0 50 0 100
2.5 ( 2 ) (1)
#include <stdio.h>
double f(double x, double y);
double g(double x, double y);
int main(){
double x,y,u,v;
x=2.0;
y=2.0;
u=f(x,y);
v=g(x,y);
return(0);
}
double f(double x, double y){
return(x/(x*x+y*y));
}
double g(double x, double y){
return(-y/(x*x+y*y));
}
(2)
2.6 ( 2 )
(1) (calresult)
[ ] [ ] ( 2 )
#include <stdio.h>
#include <math.h>
main(){
[ ] *out
double pi=4.0*atan(1.0);
double theta, s, c, t;
int i;
out = [ ] (" [ ] ","w");
for(i=0;i<=100;i++){
theta = i*pi/100;
s = sin(theta);
c = cos(theta);
t = tan(theta);
[ ] (out,"%f¥t%f¥t%f¥t%f¥n",theta,s,c,t);
}
[ ] (out);
`
3. ( 15 )
C 3.1
(5 )
Hello world Hello Akita
3.2 ( 7 )
(5 )
2 C
720 24 1 2
) (
5040 120
) 6 (
6 4 2
7 5 3
x x x x
g
x x x x
x f
− +
−
=
− +
−
=
x=0 π 100
x f(x) g(x)
?
3.3 ( 7 )
e
× +
× + ×
× + × + × +
=
+ + + + + + + +
=
=∑∞
=
1 2 3 4
1 1
2 3
1 1 2 1 1 1
! 7 1
! 6 1
! 5
1
! 4 1
! 3 1
! 2 1
! 1 1
! 0 1
! 1
0
i i
e
52 3602874713 8459045235
2.71828182
= e
1 2 3 20