2 P.S.P.T. P.S.P.T. wiki 26

Size: px
Start display at page:

Download "2 P.S.P.T. P.S.P.T. wiki 26"

Transcription

1 P.S.P.T. C

2 2 P.S.P.T. P.S.P.T. wiki 26

3 3 2 1 C C C printf() C printf() scanf() C math.h if() for while do while for while

4 (Bisection method) (Newton s method) ( ) (Euler method) #define A 75 A A A A A A.2.1 printf() A A A B 78 B B B B.2.2 break continue

5 5 B.2.3 switch case B B B B B.4 malloc B.5 argv argc - main() B C 79 C C C C C C C C C C C C C C C D 80 D D D

6 6 1.1 C printf() printf() scanf() sin() math.h if if if else else if if i++ ++i for for for 1 10 ( ) while while do while for while n

7

8 8 1 C 1.1 C C C C (Language C) 1972 AT&T C C C 1.1 C 2 3 int main(void) 4 { 5 printf("hello, worldy=n"); 6 7 return 0; 8 }

9 1.1 C 9 hello, world #include<stdio.h> } 6 5 printf("hello, worldy=n"); \() () * printf() C printf() (" ") printf() (argument) *2 printf() (" ") " ' Y= printf() printf( ); Y=n Y=t Y=" Y=' Y=Y= ( ) Y=0 ( ) *1 /( ) *2

10 10 1 C 1.2 printf() 2 3 int main(void) 4 { 5 printf(" Y=n Y=n"); 6 printf(" Y=t Y=n"); 7 8 return 0; 9 } printf return TAB A C ; ( ) 5. /* */ // * *4 C 1. *3 // C++ C C++ *4

11 1.1 C ( ) 3. binary * *5

12 12 1 C ,.,,. ; int var int foo;, int foo, baa, boo; char 1 byte: int 4 byte: -2,147,483,648 2,147,483,647 float 4 byte: e e+38 double 8 byte: e e+308 double int int main(void) 4 { 5 int a; 6 double b; 7 char c; 8 9 return 0; 10 } 5,6,7

13 , = ( ). =. = ; = double pi double pi = ; char *6 ( ). char c; c = A ; int main(void) 4 { 5 int a; 6 double b; 7 char c; 8 9 a = 10; 10 b = 3.14; 11 c = A ; return 0; 14 } 9-11 a, b, c ( ) ( 123abc, xyz ) int for C ( ) *6

14 14 1 C printf() 1.1 () printf() printf(, ); %c %d 10 %f 10 %e %f %g %f %e %s printf() 2 3 int main(void) 4 { 5 int a; 6 double b; 7 char c; 8 9 a = 10; 10 b = 3.14; 11 c = A ; printf(" a %d Y=n", a); 14 printf(" b %f Y=n", b); 15 printf(" c %c Y=n", c); 16 printf("%c %d Y=n", c, c); return 0; 19 }

15 a 10 b c A A 65 char (ASCII ) ASCII ( ) %d C + - * / % (int ) * / % + - () =

16 16 1 C int main(void) 3 { 4 int a; 5 6 a = 10; 7 printf("a %dy=n", a); 8 9 a = 9 * 6; 10 printf("a %dy=n", a); a = a + 100; 13 printf("a %dy=n", a); a = a + a * a; 16 printf("a %dy=n", a); return 0; 19 } a 10 a 54 a 154 a [m/s] 20[s] 8800[m/s] x = v 0 t + 1/2at 2

17 int main(void) 4 { 5 double a, v1, v2, t, x; 6 v1 = 100.0; 7 v2 = ; 8 t = 20.0; 9 10 a = (v2 - v1) / t; / a / 11 x = v1 * t + (1.0 / 2.0) * a * t * t; / x / printf(" Y=t%f [m/s^2]y=n", a); 14 printf(" Y=t%f [m]y=n", x); return 0; 17 } [m/s^2] [m] scanf() scanf() () printf() &( ) * 7 scanf(, & ); %c %d 10 %f %lf %s double printf() %f scanf() %lf *7 scanf(), &

18 18 1 C 1.8 scanf() 2 3 int main(void) 4 { 5 int a, b, c, d; 6 7 printf(" 2 Y=n"); 8 scanf("%d %d", &a, &b); 9 10 c = a + b; 11 printf(" %d Y=n", c); 12 printf(" %d Y=nY=n", a * b); c = a / b; 15 d = a % b; 16 printf(" %d %d Y=n", c, d); return 0; 19 } scanf() () v1 v2 t 4 () () ( ) 180 = π[rad], 1 = π[rad]/180

19 1.3 C C C 1 () printf() scanf() main() Windows UNIX OS OS math.h #include <stdio.h> *8 printf() scanf() 2 stdio.h #include <math.h> math.h stdio.h math.h math.h double sin (double arg); arg[rad] double cos (double arg); arg[rad] double tan (double arg); arg[rad] double asin (double arg); arg 1 arg 1 double acos (double arg); arg 1 arg 1 double atan (double arg); arg double atan2 (double y, double x); y/x double sinh (double arg); arg double cosh (double arg); arg double tanh (double arg); arg double exp (double arg); e arg double log (double num); num 0 < num double log10 (double num); num 0 < num double pow (double base, double exp); base exp i.base > 0, ii.base = 0 exp > 0 iii.base < 0 exp = double sqrt (double num); num double fabs (double num); num double ceil (double num); num double floor (double num); num *8 stdio.h Standard I/O header I/O Input/Output ( )

20 20 1 C sin() double double printf() char int 1.9 sin() 2 #include <math.h> 3 int main(void) 4 { 5 double a; 6 7 a = ; 8 a = sin(a); 10 9 printf("sin (pi) %f Y=n", a); 11 a = ; 12 a = a / 2; 13 a = sin(a); 14 printf("sin (pi/2) %f Y=n", a); return 0; 17 } sin (pi) sin (pi/2)

21 1.3 C math.h 2 #include <math.h> 3 int main(void) 4 { 5 double a = 2.0; 6 7 printf("sin (pi/2) %f Y=n", sin( / 2)); 8 printf(" %f %f Y=n", a, sqrt(a)); 9 printf(" %g %g Y=n", -a, fabs(-a)); 10 printf("2^10 %g Y=n", pow(2, 10)); 11 printf("e^1 %g Y=n", exp(1.0)); 12 printf("ln e %f Y=n", log(exp(1.0))); return 0; 15 } sin (pi/2) ^10 e^ ln e

22 22 1 C 1.4 C A B C ( AND OR NOT)

23 > >= < <= ==!= && AND OR! NOT 100 < 'A' == 'B' 0 'A'!= 'B' < 200 && 'A' == 'B' < 200 'A' == 'B' 1!0 1!1 0!5 0 p q p&&q p q!p if() if if ( ) { ; } 1 if ( ) ;

24 24 1 C 1.11 if 2 3 int main(void) 4 { 5 int a = 30; 6 7 if (a >= 20) { 8 printf("a 20 Y=n"); 9 } printf(" Y=n"); 12 return 0; 13 } a if 2 3 int main(void) 4 { 5 int a = 10; 6 7 if (a >= 20) { 8 printf("a 20 Y=n"); 9 } printf(" Y=n"); 12 return 0; 13 }

25 else if ( ) { ; } else { ; } 1.13 if else 2 3 int main(void) 4 { 5 int a = 10; 6 7 if (a >= 20) { 8 printf("a 20 Y=n"); 9 } 10 else { 11 printf("a 19 Y=n"); 12 } printf(" Y=n"); 15 return 0; 16 } a 19

26 26 1 C else if if( 1) { 1 ; } else if ( 2) { 1 2 ; } else if ( 3) { ; } else { 1 3 ; } 1.14 else if 2 3 int main(void) 4 { 5 int a = 10; 6 7 if (a >= 20) { 8 printf("a 20 Y=n"); 9 } 10 else if (a >= 5) { 11 printf("a Y=n"); 12 } 13 else { 14 printf("a 4 Y=n"); 15 } printf(" Y=n"); 18 return 0; 19 } a 10 20

27 if ( 1) { if ( 2) { if ( 3) { ; } } } 1.15 if 2 3 int main(void) 4 { 5 int a = 40; 6 7 if (a >= 20) { 8 printf("a 20 Y=n"); 9 10 if (a >= 30) { 11 printf("a 30 Y=n"); 12 } 13 else { 14 printf("a Y=n"); 15 } 16 } else { 19 printf("a 19 Y=n"); 20 } printf(" Y=n"); 23 return 0; 24 } a 20 a 30

28 28 1 C C 2 C int main(void) 4 { 5 double a, b, c, d; 6 7 printf("a b c Y=n"); 8 scanf("%lf %lf %lf", &a, &b, &c); 9 10 d = b * b - 4 * a * c; 11 printf("(%gx^2) + (%gx) + (%g) = 0 ", a, b, c); if (d > 0) { 14 printf(" 2 Y=n"); 15 } 16 else if (d == 0) { 17 printf(" Y=n"); 18 } 19 else { 20 printf(" 2 Y=n"); 21 } return 0; 24 } a b c (1x^2) + (3x) + (2) = Fizz 7 5 Buzz 3 5 FizzBuzz

29 ( ) if C 1 1 i = i + 1; i = i - 1; i++; i--; ++ --C int main(void) 3 { 4 int i = 10; 5 int j = 100; 6 7 i++; / / 8 printf("i = %dy=n", i); 9 10 j--; / / 11 printf("j = %dy=n", j); return 0; 14 } i = 11 j = 99 ++i;

30 30 1 C --i; (ex i++) (ex ++i) i++ i i++ ++i 2 int main(void) 3 { 4 int i, j; 5 6 i = 5; 7 j = i++; 8 printf("i=%d j=%dy=n", i, j); 9 10 i = 5; 11 j = ++i; 12 printf("i=%d j=%dy=n", i, j); 13 return 0; 14 } i=6 j=5 i=6 j= for for for (; ; ) { ; } 1 for (; ; ) ; 1 10 i a

31 for int main(void) 4 { 5 int i; 6 int a = 0; 7 8 for (i = 0; i <= 10; i++) { 9 a = a + i; 10 printf("%d %dy=n", i, a); 11 } return 0; 14 } i = 0 i <= 16 for i 1 16

32 32 1 C 1.20 for 2 2 #include <math.h> 3 4 int main(void) 5 { 6 int n, An, Sn = 0; / n, An n, Sn n / 7 8 printf("ny=t2 n Y=t Y=n"); 9 for (n = 1; n <= 16; n++) { 10 An = pow(2,n); / 2 n / 11 Sn = Sn + An; 12 printf("%dy=t%dy=t%dy=n", n, An, Sn); 13 } return 0; 16 } n 2 n

33 Sn = Sn + An; Sn += An; = n 1 += n 2 n 1 -= n 2 n 1 *= n 2 n 1 /= n 2 n 1 %= n 2 n 1 + n 2 n 1 n 1 n 2 n 1 n 1 n 2 n 1 n 1 /n 2 n 1 n 1 /n 2 n = 1.21 for 1 10 ( ) 2 3 int main(void) 4 { 5 int i; 6 int a = 0; 7 8 for (i = 0; i <= 10; i++) { 9 a += i; 10 printf("%d %dy=n", i, a); 11 } return 0; 14 }

34 34 1 C while for while while ( ) { ; } 1 while ( ) ; while 1 10

35 while int main(void) 4 { 5 int i; 6 int a = 0; 7 8 i = 0; 9 while (i <= 10) { 10 a = a + i; 11 printf("%d %dy=n", i, a); 12 i++; 13 } return 0; 16 } for while 1.20 for ,000 while

36 36 1 C 1.23 while 2 2 #include <math.h> 3 4 int main(void) 5 { 6 int n=0, An=0, Sn=0; / n, An n, Sn n / 7 8 printf("ny=t2 n Y=t Y=n"); 9 while (An < 10000) { 10 n++; 11 An = pow(2, n); / 2 n / 12 Sn += An; 13 printf("%dy=t%dy=t%dy=n", n, An, Sn); 14 } 15 printf("n = %d 10,000 Y=n", n); return 0; 18 } n 2 n n = 14 10, do while while 1 do while 1

37 do { ; } while ( ) 1 do ; while ( ); 1.24 do while 2 int main(void) 3 { 4 int i = 1; 5 6 do { / 1 / 7 printf(" 1 i=%dy=n", i); 8 i++; 9 10 } while (i < 0); do { / 1 / 13 printf(" 2 i=%dy=n", i); 14 i++; 15 } while (i < 5); return 0; 18 } 1 i=1 2 i=2 2 i=3 2 i= for while for while for while

38 38 1 C 1.25 for 2 int main(void) 3 { 4 int i, n = 0; 5 6 for (i = 1; i < 11; i++) { / 1 10 / 7 n += i; 8 } 9 printf("%dy=n", n); 10 return 0; 11 } while 2 int main(void) 3 { 4 char a; 5 6 printf("a Y=n"); 7 while ( a!= A ) { / A / 8 scanf("%c", &a); 9 } return 0; 12 } A a b 1 B A S = n n=1

39 pow() 10 e = 11 n=0 1 n! f(x) = x 2 f(x) 2 x 2 x 0.1

40 40 1 C (Array) ( ) 1 [ ]; 100 int array int array[100]; double array001; double array002;... double array100; ( ) array array[2] = 100; int main(void) 4 { 5 int a[4]; 6 7 a[0] = 0; 8 a[1] = 10; 9 a[2] = 20; 10 a[3] = 30; printf("%d %d %d %dy=n", a[0], a[1], a[2], a[3]); return 0; 15 }

41 int array[5] = {134, 12, 34, 4332, 243}; int main(void) 4 { 5 int a[4] = {0, 10, 20, 30}; 6 7 printf("%d %d %d %dy=n", a[0], a[1], a[2], a[3]); 8 9 return 0; 10 } for OS

42 42 1 C int main(void) 4 { 5 int a1 = 5; 6 int a2 = 3; 7 int a3 = 8; 8 9 int b1 = 6; 10 int b2 = 9; 11 int b3 = 2; int c1, c2, c3; c1 = a1 + b1; 16 c2 = a2 + b2; 17 c3 = a3 + b3; printf("%d + %d = %dy=n", a1, b1, c1); 20 printf("%d + %d = %dy=n", a2, b2, c2); 21 printf("%d + %d = %dy=n", a3, b3, c3); return 0; 24 } = = = 10

43 int main(void) 4 { 5 int a[3] = {5, 3, 8}; 6 int b[3] = {6, 9, 2}; 7 int c[3]; 8 int i; 9 10 for (i = 0; i < 3; i++) { 11 c[i] = a[i] + b[i]; 12 printf("%d + %d = %dy=n", a[i], b[i], c[i]); 13 } return 0; 16 } = = = [ ][ ]; int 10 5 int array[10][5]; 3 int array[10][5][17]; 4 2 array [2][3] 100 array[2][3] = 100;

44 44 1 C 2 int array[3][2] = {{1, 2}, {3, 4}, {5, 6}}; = int main(void) 4 { 5 int i, j; 6 int matrixa[3][2] = { / 3 2A / 7 {1, 2}, 8 {3, 4}, 9 {5, 6} 10 }; int matrixb[3][2] = { / 3 2B / 13 {7, 8}, 14 {9, 10}, 15 {11, 12} 16 }; int matrixc[3][2]; / 3 2C / for (i = 0; i < 3; i++) { / A + B C / 21 for (j = 0; j < 2; j++) { 22 matrixc[i][j] = matrixa[i][j] + matrixb[i][j]; 23 } 24 } for (i = 0; i < 3; i++) { / C / 27 for (j = 0; j < 2; j++) { 28 printf("%dy=t", matrixc[i][j]); 29 } 30 printf("y=n"); 31 } return 0; 34 }

45 A B AB : C A B C C ij k C ij = A in B nj = A i1 B 1j + + A ik B kj n=1 for 3 C ij

46 46 1 C 1.7 main() printf() scanf() sin() sqrt() C () 2, main() main() main() main() ( ) main() /* */ #include <stdio.h>... /* */ 1( 1, 2,..., N);... N( 1, 2,..., N); int main(void) {... return 0; } /* */ 1( 1, 2,..., N) {... return ; }

47 N( 1, 2,..., N) {... return ; } main() main() void main() printf()

48 48 1 C / / 4 5 void hello(void); 6 7 int main(void) 8 { 10 9 hello(); / / 11 return 0; 12 } / / 15 void hello(void) 16 { 17 printf(" Y=n"); 18 } sum() 1

49 n 2 3 / / 4 5 int sum(int); 6 7 int main(void) 8 { 9 int n, m; 10 n = 100; 11 m = sum(n); / / printf("%dy=n", m); return 0; 16 } / 1 n / 19 int sum(int n) 20 { 21 int i; 22 int l = 0; for (i = 0; i <= n; i++) { 25 l += i; 26 } return l; 29 } 5050 int double for()

50 50 1 C double func(int n) 4 { 5 int i; 6 double x = 1.0; 7 8 for (i = 0; i <= n; i++) { 9 x = x / 2.0; 10 } return x; 13 } int main(void) 16 { 17 int n = 2; 18 double x; x = func(n); 21 printf("1 / 2^%d = %fy=n", n, x); return 0; 24 } 1 / 2^2 =

51 int main(void) 4 { 5 int x, y, i; 6 7 x = 3; 8 y = 1; 9 for (i = 1; i < x; i++) { 10 y = y + y * i; 11 } 12 printf("%d %d Y=n", x, y); x = 7; 15 y = 1; 16 for (i = 1; i < x; i++) { 17 y = y + y * i; 18 } 19 printf("%d %d Y=n", x, y); return 0; 22 } for factorial() y = factorial(4) y 4! 24 factorial() 4 24

52 52 1 C 2 3 / / 4 int factorial(int n); 5 6 int main(void) 7 { 8 int x, y; 9 10 x = 3; 11 y = factorial(x); / / 12 printf("%d %d Y=n", x, y); x = 7; 15 y = factorial(x); / / 16 printf("%d %d Y=n", x, y); return 0; 19 } / / 22 int factorial(int n) 23 { 24 int ans, i; 25 ans = 1; for (i = 1; i < n; i++) { 28 ans = ans + ans * i; 29 } return ans; / ans / 32 } factorial() n int *9 main() int x factorial() int y factorial() int n x 3 n int ans *9 factorial() int

53 return ans; ans main() int main(void) OS(MS Windows Linux ) OS int return 0; OS 0 C main() main() main() / / 4 int factorial(int n) 5 { 6 int ans, i; 7 ans = 1; 8 9 for (i = 1; i < n; i++) { 10 ans = ans + ans * i; 11 } return ans; / ans / 14 } int main(void) 17 { 18 int x, y; x = 3; 21 y = factorial(x); / / 22 printf("%d %d Y=n", x, y); x = 7; 25 y = factorial(x); / / 26 printf("%d %d Y=n", x, y); return 0; 29 }

54 54 1 C main() return * 10 main() x C (call by value) * 11 main() func x, y *10 *11

55 double func(double x); 4 5 int main(void) 6 { 7 double x, y; 8 x = 1.0; 9 y = 2.0; printf("in mainy=tx = %f y = %fy=n", x, y); 12 y = func(x); 13 printf("in mainy=tx = %f y = %fy=n", x, y); return 0; 16 } double func(double x) 19 { 20 double y; 21 x = 3.0; 22 y = 4.0; 23 printf("in funcy=tx = %f y = %fy=n", x, y); 24 return x; 25 } in main x = y = in func x = y = in main x = y = x x = 3.0 main() x n pow2() pow2(8) a n powan(3, 4) a, b, c s = 1 2 (a + b + c) S S = s(s a)(s b)(s c)

56 56 2 x t x(t) t t = 0 () t t x(t) t = a x(a) 2 LU ()

57 y = f(x) x x = α f(α) = 0 x = α f(x) = 0 α ( ) (Bisection method) (Newton s method) (Bisection method) 1 f(x) 2 ε( ) f(x) 2 a, b(a < b) f(a) < 0, f(b) > 0 (f(a) > 0, f(b) < 0 f(x) f(x) ) 1. a b 2. a b c 3. f(c) > 0 c, b c a 4. f(c) < 0 a, c c b 5. f(c) > ε 2 f(c) ε c x 2 2 = 0

58 #include <math.h> 3 4 int main(void) 5 { 6 double a = 0.0, b = 10.0, c, fc, eps; 7 int i = 0; 8 eps = ; / ( ) / 9 10 c = (a + b) / 2; 11 fc = c * c - 2; / / printf("iy=tay=ty=tcy=ty=tby=ty=tfcy=n"); while (fabs(fc) > eps) { 16 printf("%dy=t%fy=t%fy=t%fy=t%fy=n", i, a, c, b, fc); if (fc > 0) b = c; 19 else a = c; c = (a + b) / 2; 22 fc = c * c - 2; i++; 25 } printf("%dy=t%fy=t%fy=t%fy=t%fy=n", i, a, c, b, fc); 28 return 0; 29 }

59 i a c b fc (Newton s method) x k+1 = x k f(x k) f (x k ) (2.1) x = lim k x k = α f(x k ) ε x k x 2 2 = 0

60 #include <math.h> 3 4 int main(void) 5 { 6 double x, eps; 7 int i = 0; 8 x = 10.0; / x0 / 9 eps = ; / ( ) / printf("iy=txy=ty=tfxy=n"); / f(x) 0 / 15 while (fabs(x * x - 2) > eps) { 16 printf("%dy=t%fy=t%fy=n", i, x, x * x - 2); 17 x = x - (x * x - 2) / (2 * x); / / 18 i++; } printf("%dy=t%fy=t%fy=n", i, x, x * x - 2); 23 return 0; 24 } i x fx x 0 (2.2) y = f(x) x x = α α x = x 0 f(x) f(x) x x 1 x = lim k x k = α (2.1)

61 (2.1) f(x) (Taylor expansion) f(x) x = α f(x) = n=0 f (n) (α) n! (x α) n = f(α) + f (α)(x α) + f (α) 2! (x α) f (n) (α) (x α) n n! f(x) = 0 x x = x 0 x = x 0 f(x 1 ) = 0 x 1 (2.2) f(x) = f(x 0 ) + f (x 0 )(x x 0 ) (2.2) f(x 1 ) = f(x 0 ) + f (x 0 )(x 1 x 0 ) = 0 (2.3) x 1 = x 0 f(x 0) f (x 0 ) (2.4) x 1 x 2 (2.4) x 0 x 1 x 1 x 2 f(x 2 ) = f(x 1 ) + f (x 1 )(x 2 x 1 ) = 0 (2.5) x 2 = x 1 f(x 1) f (x 1 ) (2.6) (2.1) (2.4) f(x) = 0 f(x) x + log x = 0 x 3 2x + 2 = 0 x 0 = 1.0

62 ( ) ( ) 2 x(t) t x t x F,m m d2 x(t) dt 2 = F (2.7) a F = ma (2.7) 2 d 2 x(t) dt 2 = a (2.8) dx(t) dt = at + C 1 (2.9) x(t) = 1 2 at2 + C 1 t + C 2 (2.10) ( ) C 1, C 2 1 (2.10) C 1 v 0 C 2 x 0 x(t) t (2.7) 2 (2.7) dx(t) dt dv(t) dt 1 = v(t) (2.11) = a (2.12) t x t 0 t n t x x n t x x t dx dt ( t = 0.01) x

63 (2.10) d 2 θ(t) dt 2 = g sin θ(t) (2.13) l sin θ *1 sin θ θ ( ) g θ(t) = θ 0 sin l t + δ (2.14) t θ(t) *2 t (Euler method) (Euler method) x k+1 = x k + hf(x k, t k ) (2.15) 1 dx dt = f(x(t), t) (2.16) t x t = t 0, t 1, t 2,, t k,, t n x x = x 0, x 1, x 2,, x k,, x n t t h ( t = h = t k+1 t k ) (2.16) dx dt t=tk x t t=tk = x k+1 x k h (2.17) (2.16) (2.17) x k+1 = x k + hf(x k, t k ) (2.18) x t ( ) f(x k, t k ) h t k x k ( ) h x(k + 1) *1 *2 θ 0 δ

64 64 2 (2.3) x k, t k h x k+1 x k (k = 0 x 0 ) x k+1 x k+1 x(t) k lim h 0 h dx = t x(0) = 0 t = 5 dt

65 int main(void) 4 { 5 double x, t, h, t last; 6 x = 0; 7 t = 0; 8 h = 0.01; 9 t last = 5.0; printf("#ty=txy=n"); 12 while (t <= t last) { 13 x = x + h * (t); / / 14 printf("%fy=t%fy=n", t, x); 15 t = t + h; 16 } 17 printf("%fy=t%fy=n", t, x); 18 return 0; 19 } #t x dx = x(t) x(0) = 1 t = 5 dt

66 int main(void) 4 { 5 double x, t, h, t last; 6 x = 1; 7 t = 0; 8 h = 0.01; 9 t last = 5.0; printf("#ty=txy=n"); 12 while (t <= t last) { 13 x = x + h * (x); / / 14 printf("%fy=t%fy=n", t, x); 15 t = t + h; 16 } 17 printf("%fy=t%fy=n", t, x); 18 return 0; 19 } #t x dx = cos(t) x(0) = 1 t = 7 dt dx = x cos(t) x(0) = 1 t = 7 dt

67 d 2 x(t) dt 2 = f(x(t), t) (2.19) 2 dx(t) dt dg(x(t), t) dt = g(x(t), t) (2.20) = f(x(t), t) (2.21) g x y d 2 y(t) dt 2 = g (2.22) 1 dy(t) dt dv y (t) dt = v y (t) (2.23) = g (2.24)

68 int main(void) 4 { 5 double t, y, vy; 6 double h, t last; h = 0.1; 9 t last = 10.0; 11 / / 12 t = 0.0; 13 y = 0.0; 14 vy = 0.0; while (t < t last) { 17 printf("%fy=t%fy=t%fy=n", t, y, vy); 18 y = y + h * (vy); / / 19 vy = vy + h * (-9.8); / / 20 t = t + h; 21 } 22 return 0; 23 } 2.4 t y t v 2.5 x y #define

69 #define #define g 9.8 g 9.8 #define #define #define g 9.8

70 #define G double f(double a); 5 double g(double v); 6 7 int main(void) 8 { 9 double t, y, vy; 10 double h, t last; h = 0.1; 13 t last = 10.0; / / 16 t = 0.0; 17 y = 0.0; 18 vy = 0.0; while (t < t last) { printf("%fy=t%fy=t%fy=n", t, y, vy); 22 y = y + h * g(vy); / / 23 vy = vy + h * f(-g); / / 24 t = t + h; 25 } 26 return 0; 27 } double f(double a) 30 { 31 return a; 32 } double g(double v) 35 { 36 return v; 37 }

71 x x x 1 d 2 x(t) dt 2 = 0 (2.25) dx(t) dt = v x (t) (2.26) dv x dt = 0 (2.27) #define G double f(double a); 5 double g(double v); 6 7 int main(void) 8 { 9 double t, x, y, vx, vy; 10 double h, t last; h = 0.1; 13 t last = 10.0; / / 16 t = 0.0; 17 x = 0.0; 18 y = 0.0; 19 vx = 1.0; 20 vy = 50.0; while (t < t last) { 23 printf("%fy=t%fy=t%fy=n", t, x, y); / x / 26 x = x + h * g(vx); 27 vx = vx + h * f(0); / y / 30 y = y + h * g(vy); 31 vy = vy + h * f(-g); t = t + h;

72 } 35 return 0; 36 } double f(double a) 39 { 40 return a; 41 } double g(double v) 44 { 45 return v; 46 } k d 2 x(t) dt 2 = kx(t) (2.28) 1 θ l g d 2 θ(t) dt 2 = g sin θ(t) (2.29) l 2 dv θ (t) dt dθ(t) dt 2 #include <math.h> 3 #define G #define L = v θ (t) (2.30) = g sin θ(t) (2.31) l

73 / / 7 double f(double theta); 8 double g(double vtheta); 9 10 / x y / 11 double x(double theta); 12 double y(double vtheta); int main(void) 15 { 16 double t, theta, vtheta; 17 double h, t last; h = 0.1; 20 t last = 10.0; / / 23 t = 0.0; 24 theta = 1.0; 25 vtheta = 0.0; while (t < t last) { 28 printf("%fy=t%fy=t%fy=t%fy=t%fy=n", t, theta, vtheta, x(theta), y(theta)); theta = theta + h * g(vtheta); / g(v )dt / 31 vtheta = vtheta + h * f(theta); / v f( )dt / t = t + h; 34 } 35 return 0; 36 } / / 39 double f(double theta) 40 { 41 return -G / L * sin(theta); 42 } double g(double vtheta) 45 { 46 return vtheta; 47 } / x y / 50 double x(double theta) 51 { 52 return L * sin(theta); 53 }

74 double y(double theta) 56 { 57 return L - L * cos(theta); 58 } 2.7 t θ 2.8 x y

75 75 A A.1 A.1.1 _ for i j k i j k l m n A.1.2 ( ) 4 8 { ( ) } { for (...), while (...), if (...), switch (...), case (...)

76 76 A printf(...), scanf(...), sin(...), etc... x + y, x * y, x == y, etc... &x, *x, ++i, i++, etc..., A.1.3 goto 3 Linux *1 A.2 ( ) 3. / / 2 0 A.2.1 printf() printf() *1

77 A.2 77 A.2.2 printf() / #define DEBUG #ifdef DEBUG printf(...); #endif DEBUG #ifdef DEBUG endif DEBUG #ifdef #endif #define DEBUG / A.2.3 () 1 ( ) Borland C++ Turbo Debuger GCC GDB Visual Studio A.2.4 A.1 *2 & *2

78 78 B B.1 B.2 B.2.1 B.2.2 B.2.3 break continue switch case B.3 B.3.1 B.3.2 B.3.3 B.4 malloc - B.5 argv argc - main() B.6

79 79 C C.1 C.1.1 C.2 C.2.1 C.2.2 C.3 C.3.1 C.4 C.4.1 C.5 C.6 C.6.1 C.7 C.7.1 C.7.2 2

80 80 D D.1 D.2 D.3

81 81 [1]. 2008, [2] B.W. D.M.. C ,. [3] Herbert Schildt. C ,. [4]. ANSI C C ,. [5]. C. 2008, [6] , [7] FORTRAN , [8]. 1 (I). 1982,. [9]. C. 1991, [10] C mk/labo/studying-c/programing-in-c/programing-in-c.html [11] Wikipedia

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

[1] #include<stdio.h> main() { printf(hello, world.); return 0; } (G1) int long int float ± ± [1] #include printf("hello, world."); (G1) int -32768 32767 long int -2147483648 2147483647 float ±3.4 10 38 ±3.4 10 38 double ±1.7 10 308 ±1.7 10 308 char [2] #include int a, b, c, d,

More information

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.  このサンプルページの内容は, 新装版 1 刷発行時のものです. C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009383 このサンプルページの内容は, 新装版 1 刷発行時のものです. i 2 22 2 13 ( ) 2 (1) ANSI (2) 2 (3) Web http://www.morikita.co.jp/books/mid/009383

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² –

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² – (2018) 11 2018 12 13 2 g v dv x dt = bv x, dv y dt = g bv y (1) b v 0 θ x(t) = v 0 cos θ ( 1 e bt) (2) b y(t) = 1 ( v 0 sin θ + g ) ( 1 e bt) g b b b t (3) 11 ( ) p14 2 1 y 4 t m y > 0 y < 0 t m1 h = 0001

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó  ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý (2018) 2018 7 5 f(x) [ 1, 1] 3 3 1 3 f(x) dx c i f(x i ) 1 0 i=1 = 5 ) ( ) 3 ( 9 f + 8 5 9 f(0) + 5 3 9 f 5 1 1 + sin(x) θ ( 1 θ dx = tan 1 + sin x 2 π ) + 1 4 1 3 [a, b] f a, b double G3(double (*f)(),

More information

1 4 2 EP) (EP) (EP)

1 4 2 EP) (EP) (EP) 2003 2004 2 27 1 1 4 2 EP) 5 3 6 3.1.............................. 6 3.2.............................. 6 3.3 (EP)............... 7 4 8 4.1 (EP).................... 8 4.1.1.................... 18 5 (EP)

More information

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in C 1 / 21 C 2005 A * 1 2 1.1......................................... 2 1.2 *.......................................... 3 2 4 2.1.............................................. 4 2.2..............................................

More information

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231 0 0.1 ANSI-C 0.2 web http://www1.doshisha.ac.jp/ kibuki/programming/resume p.html 0.3 2012 1 9/28 0 [ 01] 2 10/5 1 C 2 3 10/12 10 1 2 [ 02] 4 10/19 3 5 10/26 3 [ 03] 6 11/2 3 [ 04] 7 11/9 8 11/16 4 9 11/30

More information

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

tuat1.dvi

tuat1.dvi ( 1 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 6 23 ( 1 ) 1 / 58 C ( 1 ) 2 / 58 2008 9 2002 2005 T E X ptetex3, ptexlive pt E X UTF-8 xdvi-jp 3 ( 1 ) 3 / 58 ( 1 ) 4 / 58 C,... ( 1 ) 5 / 58 6/23( )

More information

kiso2-06.key

kiso2-06.key 座席指定があります Linux を起動して下さい 第6回 計算機基礎実習II 計算機基礎実習II 2018 のウェブページか ら 以下の課題に自力で取り組んで下さい 第5回の復習課題(rev05) 第6回の基本課題(base06) 第5回課題の回答例 ex05-2.c 1. キーボードから整数値 a を入力すると a*a*a の値を出力することを繰り返すプログラムを作成しなさい 2. ただし 入力された

More information

C 2 2.1? 3x 2 + 2x + 5 = 0 (1) 1

C 2 2.1? 3x 2 + 2x + 5 = 0 (1) 1 2006 7 18 1 2 C 2 2.1? 3x 2 + 2x + 5 = 0 (1) 1 2 7x + 4 = 0 (2) 1 1 x + x + 5 = 0 2 sin x x = 0 e x + x = 0 x = cos x (3) x + 5 + log x? 0.1% () 2.2 p12 3 x 3 3x 2 + 9x 8 = 0 (4) 1 [ ] 1/3 [ 2 1 ( x 1

More information

+ +

+ + + + 2 1 1 1.1................................ 1 1.2........................... 2 1.3............................. 2 1.4 ( ).................. 2 1.5........................ 3 1.6...................... 3

More information

all.dvi

all.dvi fortran 1996 4 18 2007 6 11 2012 11 12 1 3 1.1..................................... 3 1.2.............................. 3 2 fortran I 5 2.1 write................................ 5 2.2.................................

More information

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç C (3) if else switch AND && OR (NOT)! 1 BMI BMI BMI = 10 4 [kg]) ( [cm]) 2 bmi1.c Input your height[cm]: 173.2 Enter Input your weight[kg]: 60.3 Enter Your BMI is 20.1. 10 4 = 10000.0 1 BMI BMI BMI = 10

More information

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf(hello World!!\n); return 0; 戻り値 1: main() 2.2 C main C 2007 5 29 C 1 11 2 2.1 main() 1 FORTRAN C main() main main() main() 1 return 1 1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó  ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡ (2018) 2018 5 24 ( ) while ( ) do while ( ); for ( ; ; ) while int i = 0; while (i < 100) { printf("i = %3d\n", i); i++; while int i = 0; i while (i < 100) { printf("i = %3d\n", i); i++; while int i =

More information

P05.ppt

P05.ppt 2 1 list0415.c forfor #include int i, j; for (i = 1; i

More information

joho07-1.ppt

joho07-1.ppt 0xbffffc5c 0xbffffc60 xxxxxxxx xxxxxxxx 00001010 00000000 00000000 00000000 01100011 00000000 00000000 00000000 xxxxxxxx x y 2 func1 func2 double func1(double y) { y = y + 5.0; return y; } double func2(double*

More information

kiso2-09.key

kiso2-09.key 座席指定はありません 計算機基礎実習II 2018 のウェブページか 第9回 ら 以下の課題に自力で取り組んで下さい 計算機基礎実習II 第7回の復習課題(rev07) 第9回の基本課題(base09) 第8回試験の結果 中間試験に関するコメント コンパイルできない不完全なプログラムなど プログラミングに慣れていない あるいは複雑な問題は 要件 をバラして段階的にプログラムを作成する exam08-2.c

More information

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ } C 2: A Pedestrian Approach to the C Programming Language 2 2-1 2.1........................... 2-1 2.1.1.............................. 2-1 2.1.2......... 2-4 2.1.3..................................... 2-6

More information

卒 業 研 究 報 告.PDF

卒 業 研 究 報 告.PDF C 13 2 9 1 1-1. 1-2. 2 2-1. 2-2. 2-3. 2-4. 3 3-1. 3-2. 3-3. 3-4. 3-5. 3-5-1. 3-5-2. 3-6. 3-6-1. 3-6-2. 4 5 6 7-1 - 1 1 1-1. 1-2. ++ Lisp Pascal Java Purl HTML Windows - 2-2 2 2-1. 1972 D.M. (Dennis M Ritchie)

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

() x + y + y + x dy dx = 0 () dy + xy = x dx y + x y ( 5) ( s55906) 0.7. (). 5 (). ( 6) ( s6590) 0.8 m n. 0.9 n n A. ( 6) ( s6590) f A (λ) = det(a λi)

() x + y + y + x dy dx = 0 () dy + xy = x dx y + x y ( 5) ( s55906) 0.7. (). 5 (). ( 6) ( s6590) 0.8 m n. 0.9 n n A. ( 6) ( s6590) f A (λ) = det(a λi) 0. A A = 4 IC () det A () A () x + y + z = x y z X Y Z = A x y z ( 5) ( s5590) 0. a + b + c b c () a a + b + c c a b a + b + c 0 a b c () a 0 c b b c 0 a c b a 0 0. A A = 7 5 4 5 0 ( 5) ( s5590) () A ()

More information

Cプログラミング1(再) 第2回

Cプログラミング1(再) 第2回 C プログラミング 1( 再 ) 第 2 回 講義では Cプログラミングの基本を学び演習では やや実践的なプログラミングを通して学ぶ 1 前回のレポートから 前回の宿題 数あてゲーム の説明において 次のように書いていたものがいた : これはコンピュータがランダムに設定した数字を人間が当てるゲームである この説明でどこかおかしなところはないだろうか? 2 コンピュータの用語と日常的な用語の違い 物理において

More information

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

More information

P02.ppt

P02.ppt int If 2 1 ,,, 3 a + b ab a - b ab a * b ab a / b ab a % b ab a + b 4 2 list0201.c /, % /*/ int vx, vy; puts(""); printf("vx"); scanf("%d", &vx); printf("vy"); scanf("%d", &vy); printf("vx + vy = %d\n",

More information

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.   このサンプルページの内容は, 初版 1 刷発行時のものです. Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009631 このサンプルページの内容は, 初版 1 刷発行時のものです. Excel URL http://www.morikita.co.jp/books/mid/009631 i Microsoft Windows

More information

1 28 6 12 7 1 7.1...................................... 2 7.1.1............................... 2 7.1.2........................... 2 7.2...................................... 3 7.3...................................

More information

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2  2 B R b I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT

More information

A (1) = 4 A( 1, 4) 1 A 4 () = tan A(0, 0) π A π

A (1) = 4 A( 1, 4) 1 A 4 () = tan A(0, 0) π A π 4 4.1 4.1.1 A = f() = f() = a f (a) = f() (a, f(a)) = f() (a, f(a)) f(a) = f 0 (a)( a) 4.1 (4, ) = f() = f () = 1 = f (4) = 1 4 4 (4, ) = 1 ( 4) 4 = 1 4 + 1 17 18 4 4.1 A (1) = 4 A( 1, 4) 1 A 4 () = tan

More information

1.1 1 C IIA $ cd comp3a %endminipage ~/comp3a mkdir $ mkdir comp3a $ cd comp3a C.c Emacs Cntrol x Control s 2 Emacs Control-x Control-f Control-

1.1 1 C IIA $ cd comp3a %endminipage ~/comp3a mkdir $ mkdir comp3a $ cd comp3a C.c Emacs Cntrol x Control s 2 Emacs Control-x Control-f Control- 1 C IIA 1 C IIA IIA 1.1 Mac OS X 1.1.1 Mac OS X Unicode(UTF-8) UTF-8 Jedit X( ) Emacs( ) Emacs Emacs Emacs [Finder] [] Emacs dock Jedit X C 1. Jedit X Dock drag & drop Jedit X [Finder] [] Jedit X Folder

More information

数値計算

数値計算 数値計算 垣谷公徳 17 号館 3 階電子メール : kimi@ee.ous.ac.jp プログラミング言語の一般論 データ型 ( 定数と変数 配列 ) 代入 基本演算 ( 四則演算 ) 入出力 分岐 繰返処理 関数 外部手続き 1 2 入力関数 入出力 getchar, getc, fgetc ; 一文字入力 gets, fgets, fread ; 文字列 ( データ列 ) 入力 scanf,

More information

Microsoft Word - C.....u.K...doc

Microsoft Word - C.....u.K...doc C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

さくらの個別指導 ( さくら教育研究所 ) A a 1 a 2 a 3 a n {a n } a 1 a n n n 1 n n 0 a n = 1 n 1 n n O n {a n } n a n α {a n } α {a

さくらの個別指導 ( さくら教育研究所 ) A a 1 a 2 a 3 a n {a n } a 1 a n n n 1 n n 0 a n = 1 n 1 n n O n {a n } n a n α {a n } α {a ... A a a a 3 a n {a n } a a n n 3 n n n 0 a n = n n n O 3 4 5 6 n {a n } n a n α {a n } α {a n } α α {a n } a n n a n α a n = α n n 0 n = 0 3 4. ()..0.00 + (0.) n () 0. 0.0 0.00 ( 0.) n 0 0 c c c c c

More information

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

More information

1 No.1 5 C 1 I III F 1 F 2 F 1 F 2 2 Φ 2 (t) = Φ 1 (t) Φ 1 (t t). = Φ 1(t) t = ( 1.5e 0.5t 2.4e 4t 2e 10t ) τ < 0 t > τ Φ 2 (t) < 0 lim t Φ 2 (t) = 0

1 No.1 5 C 1 I III F 1 F 2 F 1 F 2 2 Φ 2 (t) = Φ 1 (t) Φ 1 (t t). = Φ 1(t) t = ( 1.5e 0.5t 2.4e 4t 2e 10t ) τ < 0 t > τ Φ 2 (t) < 0 lim t Φ 2 (t) = 0 1 No.1 5 C 1 I III F 1 F 2 F 1 F 2 2 Φ 2 (t) = Φ 1 (t) Φ 1 (t t). = Φ 1(t) t = ( 1.5e 0.5t 2.4e 4t 2e 10t ) τ < 0 t > τ Φ 2 (t) < 0 lim t Φ 2 (t) = 0 0 < t < τ I II 0 No.2 2 C x y x y > 0 x 0 x > b a dx

More information

PowerPoint Presentation

PowerPoint Presentation p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight

More information

θ (t) ω cos θ(t) = ( : θ, θ. ( ) ( ) ( 5) l () θ (t) = ω sin θ(t). ω := g l.. () θ (t) θ (t)θ (t) + ω θ (t) sin θ(t) =. [ ] d dt θ (t) ω cos θ(t

θ (t) ω cos θ(t) = ( : θ, θ. ( ) ( ) ( 5) l () θ (t) = ω sin θ(t). ω := g l.. () θ (t) θ (t)θ (t) + ω θ (t) sin θ(t) =. [ ] d dt θ (t) ω cos θ(t 7 8, /3/, 5// http://nalab.mind.meiji.ac.jp/~mk/labo/text/furiko/ l (, simple pendulum) m g mlθ (t) = mg sin θ(t) () θ (t) + ω sin θ(t) =, ω := ( m ) ( θ ) sin θ θ θ (t) + ω θ(t) = ( ) ( ) g l θ(t) = C

More information

joho09.ppt

joho09.ppt s M B e E s: (+ or -) M: B: (=2) e: E: ax 2 + bx + c = 0 y = ax 2 + bx + c x a, b y +/- [a, b] a, b y (a+b) / 2 1-2 1-3 x 1 A a, b y 1. 2. a, b 3. for Loop (b-a)/ 4. y=a*x*x + b*x + c 5. y==0.0 y (y2)

More information

I, II 1, A = A 4 : 6 = max{ A, } A A 10 10%

I, II 1, A = A 4 : 6 = max{ A, } A A 10 10% 1 2006.4.17. A 3-312 tel: 092-726-4774, e-mail: hara@math.kyushu-u.ac.jp, http://www.math.kyushu-u.ac.jp/ hara/lectures/lectures-j.html Office hours: B A I ɛ-δ ɛ-δ 1. 2. A 1. 1. 2. 3. 4. 5. 2. ɛ-δ 1. ɛ-n

More information

C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1

C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1 C++ 2018 7 1, 2018 11 4 http://nalab.mind.meiji.ac.jp/~mk/labo/text/nantoka-c++/ 1 C++ C C++ C++ C cpprefjp - C++ 1 C++17 2 2 CUI 2.1 donothing.cpp 1 /* 2 * donothing.cpp 3 */ 4 5 int main() 6 7 return

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó  ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡ (2018) 2018 5 17 0 0 if switch if if ( ) if ( 0) if ( ) if ( 0) if ( ) (0) if ( 0) if ( ) (0) ( ) ; if else if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 (0) 2 if else

More information

c-all.dvi

c-all.dvi III(994) (994) from PSL (9947) & (9922) c (99,992,994,996) () () 2 3 4 (2) 2 Euler 22 23 Euler 24 (3) 3 32 33 34 35 Poisson (4) 4 (5) 5 52 ( ) 2 Turbo 2 d 2 y=dx 2 = y y = a sin x + b cos x x = y = Fortran

More information

(1 ) scanf(

(1 ) scanf( I 1 C 1 1.1.................................... 1 1.2.................................... 1 1.3.................................... 2 1.4............................ 2 1.4.1.............................

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

Microsoft PowerPoint - 説明3_if文switch文(C_guide3)【2015新教材対応確認済み】.pptx

Microsoft PowerPoint - 説明3_if文switch文(C_guide3)【2015新教材対応確認済み】.pptx 情報ネットワーク導入ユニット Ⅰ C 言語 if 文 switch 文 3 章 : プログラムの流れの分岐 if 文 if( 条件 ) 条件が成立すれば実行 if( 条件 ) ~ else 場合分け ( 成立, 不成立 ) if( 条件 A) ~ else if( 条件 B) ~ else if( 条件 C) ~ else 場合分け ( 複数の条件での場合分け ) 等価演算子 : == ( 等しい

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

num2.dvi

num2.dvi kanenko@mbk.nifty.com http://kanenko.a.la9.jp/ 16 32...... h 0 h = ε () 0 ( ) 0 1 IEEE754 (ieee754.c Kerosoft Ltd.!) 1 2 : OS! : WindowsXP ( ) : X Window xcalc.. (,.) C double 10,??? 3 :, ( ) : BASIC,

More information

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1: 005 9 7 1 1.1 1 Hello World!! 5 p r i n t f ( H e l l o World!! \ n ) ; 7 return 0 ; 8 } 1: 1 [ ] Hello World!! from Akita National College of Technology. 1 : 5 p r i n t f ( H e l l o World!! \ n ) ;

More information

tuat2.dvi

tuat2.dvi ( 2 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 7 7 ( 2 ) 1 / 54 (1) (2) (?) (1) (2) 2 ( 2 ) 2 / 54 1. 30 2. 2012 6 30 25 OS ( 2 ) 3 / 54 10 20 1993 1996 2000 2003 = 30 ( 2 ) 4 / 54 1 2 2 ( 2 ) 5 /

More information

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i )

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i ) 1 f(x) a b f(x)dx = n A(x i ) (1) ix [a, b] n i A(x i ) x i 1 f(x) [a, b] n h = (b a)/n y h = (b-a)/n y = f (x) h h a a+h a+2h a+(n-1)h b x 1: 1 x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x

More information

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

#A A A F, F d F P + F P = d P F, F y P F F x A.1 ( α, 0), (α, 0) α > 0) (x, y) (x + α) 2 + y 2, (x α) 2 + y 2 d (x + α)2 + y 2 + (x α) 2 + y 2 =

#A A A F, F d F P + F P = d P F, F y P F F x A.1 ( α, 0), (α, 0) α > 0) (x, y) (x + α) 2 + y 2, (x α) 2 + y 2 d (x + α)2 + y 2 + (x α) 2 + y 2 = #A A A. F, F d F P + F P = d P F, F P F F A. α, 0, α, 0 α > 0, + α +, α + d + α + + α + = d d F, F 0 < α < d + α + = d α + + α + = d d α + + α + d α + = d 4 4d α + = d 4 8d + 6 http://mth.cs.kitmi-it.c.jp/

More information

I, II 1, 2 ɛ-δ 100 A = A 4 : 6 = max{ A, } A A 10

I, II 1, 2 ɛ-δ 100 A = A 4 : 6 = max{ A, } A A 10 1 2007.4.13. A 3-312 tel: 092-726-4774, e-mail: hara@math.kyushu-u.ac.jp, http://www.math.kyushu-u.ac.jp/ hara/lectures/lectures-j.html Office hours: B A I ɛ-δ ɛ-δ 1. 2. A 0. 1. 1. 2. 3. 2. ɛ-δ 1. ɛ-n

More information

新・明解C言語 ポインタ完全攻略

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

(1) (2) (3) (4) HB B ( ) (5) (6) (7) 40 (8) (9) (10)

(1) (2) (3) (4) HB B ( ) (5) (6) (7) 40 (8) (9) (10) 2017 12 9 4 1 30 4 10 3 1 30 3 30 2 1 30 2 50 1 1 30 2 10 (1) (2) (3) (4) HB B ( ) (5) (6) (7) 40 (8) (9) (10) (1) i 23 c 23 0 1 2 3 4 5 6 7 8 9 a b d e f g h i (2) 23 23 (3) 23 ( 23 ) 23 x 1 x 2 23 x

More information

pptx

pptx iphone 2010 8 18 C xkozima@myu.ac.jp C Hello, World! Hello World hello.c! printf( Hello, World!\n );! os> ls! hello.c! os> cc hello.c o hello! os> ls! hello!!hello.c! os>./hello! Hello, World!! os>! os>

More information

Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include <stdio.h> main(){ printf("hel

Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include <stdio.h> main(){ printf(hel Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include main(){ printf("hello world of C!\n"); Java: // hello.java $> javac hello.java

More information

, 1 ( f n (x))dx d dx ( f n (x)) 1 f n (x)dx d dx f n(x) lim f n (x) = [, 1] x f n (x) = n x x 1 f n (x) = x f n (x) = x 1 x n n f n(x) = [, 1] f n (x

, 1 ( f n (x))dx d dx ( f n (x)) 1 f n (x)dx d dx f n(x) lim f n (x) = [, 1] x f n (x) = n x x 1 f n (x) = x f n (x) = x 1 x n n f n(x) = [, 1] f n (x 1 1.1 4n 2 x, x 1 2n f n (x) = 4n 2 ( 1 x), 1 x 1 n 2n n, 1 x n n 1 1 f n (x)dx = 1, n = 1, 2,.. 1 lim 1 lim 1 f n (x)dx = 1 lim f n(x) = ( lim f n (x))dx = f n (x)dx 1 ( lim f n (x))dx d dx ( lim f d

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

ゲームエンジンの構成要素

ゲームエンジンの構成要素 cp-3. 計算 (C プログラムの書き方を, パソコン演習で学ぶシリーズ ) https://www.kkaneko.jp/cc/adp/index.html 金子邦彦 1 本日の内容 例題 1. 自由落下距離四則演算例題 2. 三角形の面積浮動小数の変数, 入力文, 出力文, 代入文例題 3. sin 関数による三角形の面積ライブラリ関数 2 今日の到達目標 プログラムを使って, 自分の思い通りの計算ができるようになる

More information

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf(hello World\n); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o 18 C ( ) 1 1 1.1 hello world.c 5 printf("hello World\n"); 6 } [ ] [ ] #include % cc hello_world.c %./a.out Hello World [a.out ] % cc hello_world.c -o hello_world [ ( ) ] (K&R 4.1.1) #include

More information

2014 3 10 5 1 5 1.1..................................... 5 2 6 2.1.................................... 6 2.2 Z........................................ 6 2.3.................................. 6 2.3.1..................

More information

新版明解C言語入門編

新版明解C言語入門編 175cm 60kg ( ) 175cm 175.3cm 175.869758 cm 175cm 60kg p.177 18-1 vx - vy vx vy List -1 List -1 int vx, vy; puts(""); printf(" vx "); scanf("%d", &vx); printf(" vy "); scanf("%d", &vy); printf("vx + vy

More information

z f(z) f(z) x, y, u, v, r, θ r > 0 z = x + iy, f = u + iv C γ D f(z) f(z) D f(z) f(z) z, Rm z, z 1.1 z = x + iy = re iθ = r (cos θ + i sin θ) z = x iy

z f(z) f(z) x, y, u, v, r, θ r > 0 z = x + iy, f = u + iv C γ D f(z) f(z) D f(z) f(z) z, Rm z, z 1.1 z = x + iy = re iθ = r (cos θ + i sin θ) z = x iy f f x, y, u, v, r, θ r > = x + iy, f = u + iv C γ D f f D f f, Rm,. = x + iy = re iθ = r cos θ + i sin θ = x iy = re iθ = r cos θ i sin θ x = + = Re, y = = Im i r = = = x + y θ = arg = arctan y x e i =

More information

5.. z = f(x, y) y y = b f x x g(x) f(x, b) g x ( ) A = lim h 0 g(a + h) g(a) h g(x) a A = g (a) = f x (a, b)

5.. z = f(x, y) y y = b f x x g(x) f(x, b) g x ( ) A = lim h 0 g(a + h) g(a) h g(x) a A = g (a) = f x (a, b) 5 partial differentiation (total) differentiation 5. z = f(x, y) (a, b) A = lim h 0 f(a + h, b) f(a, b) h............................................................... ( ) f(x, y) (a, b) x A (a, b) x

More information

08 p Boltzmann I P ( ) principle of equal probability P ( ) g ( )g ( 0 ) (4 89) (4 88) eq II 0 g ( 0 ) 0 eq Taylor eq (4 90) g P ( ) g ( ) g ( 0

08 p Boltzmann I P ( ) principle of equal probability P ( ) g ( )g ( 0 ) (4 89) (4 88) eq II 0 g ( 0 ) 0 eq Taylor eq (4 90) g P ( ) g ( ) g ( 0 08 p. 8 4 k B log g() S() k B : Boltzmann T T S k B g g heat bath, thermal reservoir... 4. I II II System I System II II I I 0 + 0 const. (4 85) g( 0 ) g ( )g ( ) g ( )g ( 0 ) (4 86) g ( )g ( 0 ) 0 (4

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

1 3 1.1.......................... 3 1............................... 3 1.3....................... 5 1.4.......................... 6 1.5........................ 7 8.1......................... 8..............................

More information

I No. sin cos sine, cosine : trigonometric function π : π =.4 : n =, ±, ±, sin + nπ = sin cos + nπ = cos sin = sin : cos = cos :. sin. sin. sin + π si

I No. sin cos sine, cosine : trigonometric function π : π =.4 : n =, ±, ±, sin + nπ = sin cos + nπ = cos sin = sin : cos = cos :. sin. sin. sin + π si I 8 No. : No. : No. : No.4 : No.5 : No.6 : No.7 : No.8 : No.9 : No. : I No. sin cos sine, cosine : trigonometric function π : π =.4 : n =, ±, ±, sin + nπ = sin cos + nπ = cos sin = sin : cos = cos :. sin.

More information

1.1 ft t 2 ft = t 2 ft+ t = t+ t 2 1.1 d t 2 t + t 2 t 2 = lim t 0 t = lim t 0 = lim t 0 t 2 + 2t t + t 2 t 2 t + t 2 t 2t t + t 2 t 2t + t = lim t 0

1.1 ft t 2 ft = t 2 ft+ t = t+ t 2 1.1 d t 2 t + t 2 t 2 = lim t 0 t = lim t 0 = lim t 0 t 2 + 2t t + t 2 t 2 t + t 2 t 2t t + t 2 t 2t + t = lim t 0 A c 2008 by Kuniaki Nakamitsu 1 1.1 t 2 sin t, cos t t ft t t vt t xt t + t xt + t xt + t xt t vt = xt + t xt t t t vt xt + t xt vt = lim t 0 t lim t 0 t 0 vt = dxt ft dft dft ft + t ft = lim t 0 t 1.1

More information

arctan 1 arctan arctan arctan π = = ( ) π = 4 = π = π = π = =

arctan 1 arctan arctan arctan π = = ( ) π = 4 = π = π = π = = arctan arctan arctan arctan 2 2000 π = 3 + 8 = 3.25 ( ) 2 8 650 π = 4 = 3.6049 9 550 π = 3 3 30 π = 3.622 264 π = 3.459 3 + 0 7 = 3.4085 < π < 3 + 7 = 3.4286 380 π = 3 + 77 250 = 3.46 5 3.45926 < π < 3.45927

More information

211 kotaro@math.titech.ac.jp 1 R *1 n n R n *2 R n = {(x 1,..., x n ) x 1,..., x n R}. R R 2 R 3 R n R n R n D D R n *3 ) (x 1,..., x n ) f(x 1,..., x n ) f D *4 n 2 n = 1 ( ) 1 f D R n f : D R 1.1. (x,

More information

( 12 ( ( ( ( Levi-Civita grad div rot ( ( = 4 : 6 3 1 1.1 f(x n f (n (x, d n f(x (1.1 dxn f (2 (x f (x 1.1 f(x = e x f (n (x = e x d dx (fg = f g + fg (1.2 d dx d 2 dx (fg = f g + 2f g + fg 2... d n n

More information

II Karel Švadlenka * [1] 1.1* 5 23 m d2 x dt 2 = cdx kx + mg dt. c, g, k, m 1.2* u = au + bv v = cu + dv v u a, b, c, d R

II Karel Švadlenka * [1] 1.1* 5 23 m d2 x dt 2 = cdx kx + mg dt. c, g, k, m 1.2* u = au + bv v = cu + dv v u a, b, c, d R II Karel Švadlenka 2018 5 26 * [1] 1.1* 5 23 m d2 x dt 2 = cdx kx + mg dt. c, g, k, m 1.2* 5 23 1 u = au + bv v = cu + dv v u a, b, c, d R 1.3 14 14 60% 1.4 5 23 a, b R a 2 4b < 0 λ 2 + aλ + b = 0 λ =

More information

i

i i 3 4 4 7 5 6 3 ( ).. () 3 () (3) (4) /. 3. 4/3 7. /e 8. a > a, a = /, > a >. () a >, a =, > a > () a > b, a = b, a < b. c c n a n + b n + c n 3c n..... () /3 () + (3) / (4) /4 (5) m > n, a b >, m > n,

More information

y π π O π x 9 s94.5 y dy dx. y = x + 3 y = x logx + 9 s9.6 z z x, z y. z = xy + y 3 z = sinx y 9 s x dx π x cos xdx 9 s93.8 a, fx = e x ax,. a =

y π π O π x 9 s94.5 y dy dx. y = x + 3 y = x logx + 9 s9.6 z z x, z y. z = xy + y 3 z = sinx y 9 s x dx π x cos xdx 9 s93.8 a, fx = e x ax,. a = [ ] 9 IC. dx = 3x 4y dt dy dt = x y u xt = expλt u yt λ u u t = u u u + u = xt yt 6 3. u = x, y, z = x + y + z u u 9 s9 grad u ux, y, z = c c : grad u = u x i + u y j + u k i, j, k z x, y, z grad u v =

More information

36.fx82MS_Dtype_J-c_SA0311C.p65

36.fx82MS_Dtype_J-c_SA0311C.p65 P fx-82ms fx-83ms fx-85ms fx-270ms fx-300ms fx-350ms J http://www.casio.co.jp/edu/ AB2Mode =... COMP... Deg... Norm 1... a b /c... Dot 1 2...1...2 1 2 u u u 3 5 fx-82ms... 23 fx-83ms85ms270ms300ms 350MS...

More information

S I. dy fx x fx y fx + C 3 C vt dy fx 4 x, y dy yt gt + Ct + C dt v e kt xt v e kt + C k x v k + C C xt v k 3 r r + dr e kt S Sr πr dt d v } dt k e kt

S I. dy fx x fx y fx + C 3 C vt dy fx 4 x, y dy yt gt + Ct + C dt v e kt xt v e kt + C k x v k + C C xt v k 3 r r + dr e kt S Sr πr dt d v } dt k e kt S I. x yx y y, y,. F x, y, y, y,, y n http://ayapin.film.s.dendai.ac.jp/~matuda n /TeX/lecture.html PDF PS yx.................................... 3.3.................... 9.4................5..............

More information

08-Note2-web

08-Note2-web r(t) t r(t) O v(t) = dr(t) dt a(t) = dv(t) dt = d2 r(t) dt 2 r(t), v(t), a(t) t dr(t) dt r(t) =(x(t),y(t),z(t)) = d 2 r(t) dt 2 = ( dx(t) dt ( d 2 x(t) dt 2, dy(t), dz(t) dt dt ), d2 y(t) dt 2, d2 z(t)

More information

ex12.dvi

ex12.dvi 1 0. C, char., char, 0,. C, ("),., char str[]="abc" ; str abc.,, str 4. str 3. char str[10]="abc" ;, str 10, str 3., char s[]="abc", t[10] ;, t = s. ASCII, 0x00 0x7F, char., "abc" 3, 1. 1 8 256, 2., 2

More information

‚æ2›ñ C„¾„ê‡Ìš|

‚æ2›ñ C„¾„ê‡Ìš| I 8 10 10 I ( 6 ) 10 10 1 / 23 1 C ( ) getchar(), gets(), scanf() ( ) putchar(), puts(), printf() 1 getchar(), putchar() 1 I ( 6 ) 10 10 2 / 23 1 (getchar 1 1) 1 #include 2 void main(void){ 3 int

More information

1 1.1 ( ). z = a + bi, a, b R 0 a, b 0 a 2 + b 2 0 z = a + bi = ( ) a 2 + b 2 a a 2 + b + b 2 a 2 + b i 2 r = a 2 + b 2 θ cos θ = a a 2 + b 2, sin θ =

1 1.1 ( ). z = a + bi, a, b R 0 a, b 0 a 2 + b 2 0 z = a + bi = ( ) a 2 + b 2 a a 2 + b + b 2 a 2 + b i 2 r = a 2 + b 2 θ cos θ = a a 2 + b 2, sin θ = 1 1.1 ( ). z = + bi,, b R 0, b 0 2 + b 2 0 z = + bi = ( ) 2 + b 2 2 + b + b 2 2 + b i 2 r = 2 + b 2 θ cos θ = 2 + b 2, sin θ = b 2 + b 2 2π z = r(cos θ + i sin θ) 1.2 (, ). 1. < 2. > 3. ±,, 1.3 ( ). A

More information

[ ] 0.1 lim x 0 e 3x 1 x IC ( 11) ( s114901) 0.2 (1) y = e 2x (x 2 + 1) (2) y = x/(x 2 + 1) 0.3 dx (1) 1 4x 2 (2) e x sin 2xdx (3) sin 2 xdx ( 11) ( s

[ ] 0.1 lim x 0 e 3x 1 x IC ( 11) ( s114901) 0.2 (1) y = e 2x (x 2 + 1) (2) y = x/(x 2 + 1) 0.3 dx (1) 1 4x 2 (2) e x sin 2xdx (3) sin 2 xdx ( 11) ( s [ ]. lim e 3 IC ) s49). y = e + ) ) y = / + ).3 d 4 ) e sin d 3) sin d ) s49) s493).4 z = y z z y s494).5 + y = 4 =.6 s495) dy = 3e ) d dy d = y s496).7 lim ) lim e s49).8 y = e sin ) y = sin e 3) y =

More information

fuga scanf("%lf%*c",&fuga); 改行文字を読み捨てる 10 進数の整数 おまじない取り込んだ値を代入する変数 scanf( %d%*c,&hoge); キーボードから取り込め という命令 1: scanf 1 1: int double scanf %d %lf printf

fuga scanf(%lf%*c,&fuga); 改行文字を読み捨てる 10 進数の整数 おまじない取り込んだ値を代入する変数 scanf( %d%*c,&hoge); キーボードから取り込め という命令 1: scanf 1 1: int double scanf %d %lf printf C 2007 5 16 9 1 9 9 if else for 2 hoge scanf("%d%*c",&hoge); ( 1 ) scanf 1 %d 10 2 %*c (p.337) [Enter] &hoge hoge 1 2 10 decimal number d 1 fuga scanf("%lf%*c",&fuga); 改行文字を読み捨てる 10 進数の整数 おまじない取り込んだ値を代入する変数

More information

18 ( ) I II III A B C(100 ) 1, 2, 3, 5 I II A B (100 ) 1, 2, 3 I II A B (80 ) 6 8 I II III A B C(80 ) 1 n (1 + x) n (1) n C 1 + n C

18 ( ) I II III A B C(100 ) 1, 2, 3, 5 I II A B (100 ) 1, 2, 3 I II A B (80 ) 6 8 I II III A B C(80 ) 1 n (1 + x) n (1) n C 1 + n C 8 ( ) 8 5 4 I II III A B C( ),,, 5 I II A B ( ),, I II A B (8 ) 6 8 I II III A B C(8 ) n ( + x) n () n C + n C + + n C n = 7 n () 7 9 C : y = x x A(, 6) () A C () C P AP Q () () () 4 A(,, ) B(,, ) C(,,

More information

sin cos No. sine, cosine : trigonometric function π : π = 3.4 : n = 0, ±, ±, sin + nπ = sin cos + nπ = cos : parity sin = sin : odd cos = cos : even.

sin cos No. sine, cosine : trigonometric function π : π = 3.4 : n = 0, ±, ±, sin + nπ = sin cos + nπ = cos : parity sin = sin : odd cos = cos : even. 08 No. : No. : No.3 : No.4 : No.5 : No.6 : No.7 : No.8 : No.9 : No.0 : No. : sin cos No. sine, cosine : trigonometric function π : π = 3.4 : n = 0, ±, ±, sin + nπ = sin cos + nπ = cos : parity sin = sin

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2017 2017 08 03 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF X [ S ] a S S ; X X X, S [, a, ], ; BNF X (parse tree) (1) [a;a] (2) [[a]] (3) [a;[a]] (4) [[a];a] : [a] X 2 222222

More information

2009 I 2 II III 14, 15, α β α β l 0 l l l l γ (1) γ = αβ (2) α β n n cos 2k n n π sin 2k n π k=1 k=1 3. a 0, a 1,..., a n α a

2009 I 2 II III 14, 15, α β α β l 0 l l l l γ (1) γ = αβ (2) α β n n cos 2k n n π sin 2k n π k=1 k=1 3. a 0, a 1,..., a n α a 009 I II III 4, 5, 6 4 30. 0 α β α β l 0 l l l l γ ) γ αβ ) α β. n n cos k n n π sin k n π k k 3. a 0, a,..., a n α a 0 + a x + a x + + a n x n 0 ᾱ 4. [a, b] f y fx) y x 5. ) Arcsin 4) Arccos ) ) Arcsin

More information

I No. sin cos sine, cosine : trigonometric function π : π =.4 : n = 0, ±, ±, sin + nπ = sin cos + nπ = cos : parity sin = sin : odd cos = cos : even.

I No. sin cos sine, cosine : trigonometric function π : π =.4 : n = 0, ±, ±, sin + nπ = sin cos + nπ = cos : parity sin = sin : odd cos = cos : even. I 0 No. : No. : No. : No.4 : No.5 : No.6 : No.7 : No.8 : No.9 : No.0 : I No. sin cos sine, cosine : trigonometric function π : π =.4 : n = 0, ±, ±, sin + nπ = sin cos + nπ = cos : parity sin = sin : odd

More information

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B A/B (2018/10/19) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2018/soft/soft.html 2018 10 19 A/B 1 2018 10 19 2 1 1 1.1 OHP.................................... 1

More information

.5 z = a + b + c n.6 = a sin t y = b cos t dy d a e e b e + e c e e e + e 3 s36 3 a + y = a, b > b 3 s363.7 y = + 3 y = + 3 s364.8 cos a 3 s365.9 y =,

.5 z = a + b + c n.6 = a sin t y = b cos t dy d a e e b e + e c e e e + e 3 s36 3 a + y = a, b > b 3 s363.7 y = + 3 y = + 3 s364.8 cos a 3 s365.9 y =, [ ] IC. r, θ r, θ π, y y = 3 3 = r cos θ r sin θ D D = {, y ; y }, y D r, θ ep y yddy D D 9 s96. d y dt + 3dy + y = cos t dt t = y = e π + e π +. t = π y =.9 s6.3 d y d + dy d + y = y =, dy d = 3 a, b

More information

#define N1 N+1 double x[n1] =.5, 1., 2.; double hokan[n1] = 1.65, 2.72, 7.39 ; double xx[]=.2,.4,.6,.8,1.2,1.4,1.6,1.8; double lagrng(double xx); main

#define N1 N+1 double x[n1] =.5, 1., 2.; double hokan[n1] = 1.65, 2.72, 7.39 ; double xx[]=.2,.4,.6,.8,1.2,1.4,1.6,1.8; double lagrng(double xx); main =1= (.5, 1.65), (1., 2.72), (2., 7.39).2,.4,.6,.8, 1., 1.2, 1.4, 1.6 1 1: x.2 1.4128.4 1.5372.6 1.796533.8 2.198 1.2 3.384133 1.4 4.1832 1.6 5.1172 8 7 6 5 y 4 3 2 1.5 1 1.5 2 x 1: /* */ #include

More information

S I. dy fx x fx y fx + C 3 C dy fx 4 x, y dy v C xt y C v e kt k > xt yt gt [ v dt dt v e kt xt v e kt + C k x v + C C k xt v k 3 r r + dr e kt S dt d

S I. dy fx x fx y fx + C 3 C dy fx 4 x, y dy v C xt y C v e kt k > xt yt gt [ v dt dt v e kt xt v e kt + C k x v + C C k xt v k 3 r r + dr e kt S dt d S I.. http://ayapin.film.s.dendai.ac.jp/~matuda /TeX/lecture.html PDF PS.................................... 3.3.................... 9.4................5.............. 3 5. Laplace................. 5....

More information