Microsoft Word - no14.docx

Similar documents
Microsoft Word - no202.docx

Microsoft Word - no13.docx

Microsoft Word - no15.docx

Microsoft Word - no12.doc

main

Microsoft Word - no15.docx

PowerPoint Presentation

P05.ppt

Microsoft Word - no205.docx

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

1 4 2 EP) (EP) (EP)

Microsoft Word - no11.docx

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

Microsoft Word - no103.docx

P06.ppt

P02.ppt

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

新・明解C言語で学ぶアルゴリズムとデータ構造

プログラミング基礎

新版明解C言語 実践編

#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

kiso2-09.key

Microsoft Word - no206.docx

PowerPoint プレゼンテーション


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

新・明解C言語 実践編

Microsoft PowerPoint - program.ppt [互換モード]

新版明解C言語入門編

17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include<stdio

解きながら学ぶC言語

r08.dvi

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

Microsoft PowerPoint - 説明2_演算と型(C_guide2)【2015新教材対応確認済み】.pptx

ohp08.dvi

ex14.dvi

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >=

Microsoft Word - Cプログラミング演習(12)

DVIOUT

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

初歩のC言語ターミナル_2014_May.pages

Microsoft PowerPoint - 12.ppt [互換モード]

r07.dvi

ohp07.dvi

& & a a * * ptr p int a ; int *a ; int a ; int a int *a

演習課題No12

Taro-最大値探索法の開発(公開版

PowerPoint Presentation

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y

演算増幅器

‚æ4›ñ

C B

1.ppt

02: 変数と標準入出力

C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf ("sum=%d n",sum); 2

02: 変数と標準入出力

XMPによる並列化実装2

ex01.dvi

Microsoft PowerPoint - 14Chap17.ppt

C言語講座 後半

Microsoft Word - no204.docx

kiso2-06.key

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

I void* School of Information Science, Japan Advanced Institute of Science and Technology

3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout <<

Microsoft Word - Cプログラミング演習(7)

ex12.dvi

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B

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-

関数 C 言語は関数の言語 関数とは 関数の定義 : f(x) = x * x ; 使うときは : y = f(x) 戻り値 引数

/* 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 */ }

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

超初心者用

[Problem F] 古い記憶 良さそうな方法は思いつかなかった アイディア募集中!!! かなり強引に解いている 各判定データに対して 30 秒程度かかる 元の文章と改ざん文章の関係を考える ウィルス感染の可能性は高々 2 回であり 各々の感染では 1 文字削除 1 文字追加 1 文字変更が行われ

printf("5つの整数を入力して下さい \n"); /* データ入力 */ for( /*** 02 ***/ ){ printf("%dつ目の入力 :",i+1); scanf("%d", /*** 03 ***/ ); sum=dat[0]; /* 合計値の初期設定 */ n_max= 0

char int float double の変数型はそれぞれ 文字あるいは小さな整数 整数 実数 より精度の高い ( 数値のより大きい より小さい ) 実数 を扱う時に用いる 備考 : 基本型の説明に示した 浮動小数点 とは数値を指数表現で表す方法である 例えば は指数表現で 3 書く

<4D F736F F D20438CBE8CEA8D758DC03389F0939A82C282AB2E646F63>

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル

Microsoft PowerPoint - class04.ppt

プログラミング方法論 II 第 14,15 回 ( 担当 : 鈴木伸夫 ) 問題 17. x 座標と y 座標をメンバに持つ構造体 Point を作成せよ 但し座標 は double 型とする typedef struct{ (a) x; (b) y; } Point; 問題 18. 問題 17 の

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

untitled

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)* (

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

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

ファイル入出力

C 言語第 3 回 2 a と b? 関係演算子 a と b の関係 関係演算子 等しい a==b 等しくない a!=b より大きい a>b 以上 a>=b より小さい a<b 以下 a<=b 状態 真偽 値 条件が満たされた場合 TRUE( 真 ) 1(0 以外 ) 条件が満たされなかった場合 F

gengo1-11


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

A/B (2018/06/08) Ver kurino/2018/soft/soft.html A/B

PowerPoint プレゼンテーション

/

Microsoft Word - 05

C言語7

1 ( )

Microsoft PowerPoint - 12.ppt [互換モード]

02: 変数と標準入出力

/* 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

実際の株価データを用いたオプション料の計算

Transcription:

ex26.c #define MAX 20 int max(int n, int x[]); int num[max]; int i, x; printf(" "); scanf("%d", &x); if(x > MAX) printf("%d %d \n", MAX, MAX); x = MAX; for(i = 0; i < x; i++) printf("%3d : ", i + 1); scanf("%d", &num[i]); printf("%d \n", max(x, num)); int max(int n, int x[]) int i, m = x[0]; for(i = 1; i < n; i++) if(m < x[i]) m = x[i]; return(m); str[][] num []

ex27.c int calc1(int x, int y); int calc2(int x[]); int num[2], n; num[0] = 10; num[1] = 10; n = calc1(num[0], num[1]); printf("num[0]=%2d, num[1]=%2d, n=%2d\n", num[0], num[1], n); n = calc2(num); printf("num[0]=%2d, num[1]=%2d, n=%2d\n", num[0], num[1], n); int calc1(int x, int y) x = x - 1; if(x > 0) y = y - 1; else y = y + 1; return(x + y); int calc2(int x[]) x[0] = x[0] - 1; if(x[0] > 0) x[1] = x[1] - 1; else x[1] = x[1] + 1; return(x[0] + x[1]); int int

ex28.c #define MAXLEN 80 int length(char str[]); int to_upper(char str[]); char string[maxlen + 1]; printf(": "); scanf("%80s", string); printf("%d \n", length(string)); to_upper(string); printf("%s \n", string); int length(char str[]) int i, len = 0; for(i = 0; str[i]!= '\0'; i++) len++; return(len); int to_upper(char str[]) int i, c = 0; for(i = 0; str[i]!= '\0'; i++) if((str[i] >= 'a') && (str[i] <= 'z')) str[i] -= 32; c++; return(c);

main array_sum_sqr array_average ex29.c #define MAX 20 array_sum_sqr( ); array_average( ); int num[max]; int i, x; printf(" "); scanf("%d", &x); if(x > MAX) printf("%d %d \n", MAX, MAX); x = MAX; for(i = 0; i < x; i++) printf("%3d : ", i + 1); scanf("%d", &num[i]); printf(" \n", array_sum_sqr( )); printf(" \n", array_average( ));

ex30.c /* */ /* */ double mulreal(double, double, double, double); double mulimage(double, double, double, double); void printcomplex(double, double); double areal, aimage; /* a */ double breal, bimage; /* b */ double creal, cimage; /* c */ printf("a : "); scanf("%lf", &areal); printf("a : "); scanf("%lf", &aimage); printf("b : "); scanf("%lf", &breal); printf("b : "); scanf("%lf", &bimage); creal = mulreal(areal, aimage, breal, bimage); /* */ cimage = mulimage(areal, aimage, breal, bimage); /* */ printcomplex(areal, aimage); printf(" * "); printcomplex(breal, bimage); printf(" = "); printcomplex(creal, cimage); printf("\n"); /* */ double mulreal(double xreal, double ximage, double yreal, double yimage) return xreal * yreal - ximage * yimage; /* */ double mulimage(double xreal, double ximage, double yreal, double yimage) return xreal * yimage + ximage * yreal; /* */ void printcomplex(double xreal, double ximage) printf("(%f%+fi)", xreal, ximage);

ex31.c /* */ /* */ struct complex double real; /* */ double image; /* */ ; /* */ struct complex mul(struct complex x, struct complex y); void printcomplex(struct complex x); struct complex a, b, c; /* a, b, c */ printf("a : "); scanf("%lf", &a.real); printf("a : "); scanf("%lf", &a.image); printf("b : "); scanf("%lf", &b.real); printf("b : "); scanf("%lf", &b.image); c = mul(a, b); /* */ printcomplex(a); printf(" * "); printcomplex(b); printf(" = "); printcomplex(c); printf("\n"); /* */ struct complex mul(struct complex x, struct complex y) struct complex z; z.real = x.real * y.real - x.image * y.image; z.image = x.real * y.image + x.image * y.real; return z; /* */ void printcomplex(struct complex x) printf("(%f%+fi)", x.real, x.image);

c = a 1 2 doible struct 1 1;... (); struct ;.. ex32.c /* */ /* */ struct ; /* */ ; /* */ ; /* */ mul( x, y); void print ( x); a, b, c; /* a, b, c */ printf("a : "); scanf("%d", &a. ); printf("a : "); scanf("%d", &a. ); printf("b : "); scanf("%d", &b. ); printf("b : "); scanf("%d", &b. );

c = mul(a, b); /* */ print (a); printf(" * "); print (b); printf(" = "); print (c); printf("\n");