P05.ppt

Similar documents
P06.ppt

PowerPoint Presentation

P02.ppt

main

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

P03.ppt

新版明解C言語入門編

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

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

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

超初心者用

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

‚æ4›ñ

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

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

tuat1.dvi

untitled

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言語 ポインタ完全攻略

Microsoft Word - no14.docx

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

新版明解C言語 実践編

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

C C UNIX C ( ) 4 1 HTML 1

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

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

解きながら学ぶC言語

1.ppt

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

Microsoft Word - no15.docx

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

[ 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:

C言語7


Łñ“’‘‚2004

プリント

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

講習No.12

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


kiso2-09.key

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


untitled

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

Microsoft PowerPoint - C言語の復習(配布用).ppt [互換モード]

gengo1-10

Informatics 2010.key

新・明解C言語 実践編

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

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

1-4 int a; std::cin >> a; std::cout << "a = " << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >>

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

Informatics 2014

t 2 2 t 2 t F ( ) p- 2 2 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 2

Taro-リストⅢ(公開版).jtd

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

gengo1-2

PowerPoint プレゼンテーション

cp-7. 配列

double float

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

double 2 std::cin, std::cout 1.2 C fopen() fclose() C++ std::fstream 1-3 #include <fstream> std::fstream fout; int a = 123; fout.open( "data.t

Microsoft Word - no15.docx

1 4 2 EP) (EP) (EP)

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

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

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

Taro-プログラミングの基礎Ⅱ(公

kiso2-03.key

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

ex14.dvi

/*Source.cpp*/ #include<stdio.h> //printf はここでインクルードして初めて使えるようになる // ここで関数 average を定義 3 つの整数の平均値を返す double 型の関数です double average(int a,int b,int c){

tuat2.dvi

プログラミング演習 土曜日(Q組)

Microsoft Word - 3new.doc

Taro-リストⅠ(公開版).jtd

Microsoft Word - no206.docx

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

kiso2-06.key

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

gengo1-11

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-

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

: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology

Informatics 2015

(search: ) [1] ( ) 2 (linear search) (sequential search) 1

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

untitled

comment.dvi

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 )

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

Cプログラミング - 第8回 構造体と再帰

Microsoft Word - C言語研修 C++編 3.doc

untitled

C B

C プログラミング演習 1( 再 ) 2 講義では C プログラミングの基本を学び 演習では やや実践的なプログラミングを通して学ぶ

2.1 programming09 programming /******************************** 2 3 ********************************/ 4 5 #include <stdio.h> 6 7 int sum(int x

Taro-2分探索木Ⅱ(公開版).jtd

情報処理演習 B8クラス

Transcription:

2 1

list0415.c forfor #include <stdio.h> int i, j; for (i = 1; i <= 9; i++) for (j = 1; j <= 9; j++) printf( "%3d", i * j ); printf( \n ); 3 forfor ifif for for (i = 1; i <= 9; i++) for for (j = 1; j <= 9; j++) printf( \n ); i=1 printf( "%3d", i * j ); j=19 1 19 i=2 1 2 3 4 5 6 7 8 9\n 2 4 6 8 10 12 14 16 18\n i 4 2

list0417.c #include <stdio.h> int i, j; int width, height; puts( "); printf(""); scanf("%d", &width); printf(""); scanf("%d", &height); for (i = 1; i <= height; i++) for (j = 1; j <= width; j++) printf( * ); printf( \n ); 5 2 1 int ma[2]; i ma[0] i=0 ma[1] i=1 2 j=0 j=1 j=2 i j int ma[2][3]; i=0 i=1 ma[0][0] ma[1][0] ma[0][1] ma[1][1] ma[0][2] ma[1][2] 2 x 3 2 6 3

list0514.c 2 #include <stdio.h> int i, j; int ma[2][3] = 1, 2, 3, 4, 5, 6 ; int mb[2][3] = 6, 3, 4, 5, 1, 2 ; int mc[2][3] = 0 ; for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) mc[i][j] = ma[i][j] + mb[i][j]; for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) printf("%3d", mc[i][j]); printf( \n ); 7 2 int ma[2][3] = 1, 2, 3, 4, 5, 6 ; int mb[2][3] = 6, 3, 4, 5, 1, 2 ; int mc[2][3] = 0 ; 1, 2, 3 0 ma[0][0] ma[1][0] ma[0][1] ma[1][1] ma[0][2] ma[1][2] 4, 5, 6 8 4

2?x? Pixel 2image[ i ][ j ] RGB 9 printf, puts, putchar scanf 10 5

double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i < NUM; i++ ) if ( weight[i] > max ) max = weight[i]: if ( weight[i] < min ) min = weight[i]: etc 11 include <stdio.h> return(0); main C main 12 6

printf( dn, num ); puts( scanf( d, &num ); C 13 14 7

include <stdio.h> printf(); scanf(); return(0); include stdio.h> (Standard input output header) printf, puts, scanf printf stdio.h 15 list0601.c (p.115) include <stdio.h> int maxof(int x, int y) if (x > y) else int na, nb, max; return (x); return (y); puts(" printf(" scanf("%d", &na); printf(" scanf("%d", &nb); max = maxof( na, nb ); printf("dn", max ); main 16 8

maxof int int int maxof( int x, int y ) if (x > y) return (x); else return (y); int int maxof return 17 maxof main int na, nb, max; max = maxof( na, nb ); maxof(na, nb) int maxof( int x, int y ) if (x > y) return (x); else return (y); maxof 18 9

main int na, nb, max; na = 24; nb = 62; max = maxof( na, nb ); return int maxof( int x, int y ) na, nbx, y if (x > y) return (x); else return (y); 19 List0601int int minof(int x, int y) main include <stdio.h> int minof(int x, int y) if (x < y) else int na, nb, min; return (x); return (y); puts(" printf(" scanf("%d", &na); printf(" scanf("%d", &nb); min = minof( na, nb ); printf( dn", min ); 20 10

list0602.c (p.118) double include <stdio.h> double max3(double x, double y, double z) double max = x; if (y > max) max = y; if (z > max) max = z; return (max); double na, nb, nc; puts( printf( scanf("%lf", &na); printf( scanf("%lf", &nb); printf( scanf("%lf", &nc); double scanflf printf( f n", max3(na, nb, nc)); 21 double max3(double x, double y, double z) double max = x; if (y > max) max = y; if (z > max) max = z; return (max); double max printf( f n", max3(na, nb, nc)); 22 11

menseki.c a, b a, b b S include <stdio.h> a double menseki(double x, double y ) double s; s = x * y / 2.0; return( x * y / 2.0 ); return (s); double a, b; puts( printf( scanf("%lf", &a); printf( scanf("%lf", &b); printf( f n", menseki( a, b) ); 23 hello.c Hello! include <stdio.h> void hello(void) puts( Hello!! ); hello( ); 24 12

void hello(void) void void main int(0) 25 no void put_stars( int no ) stars.c include <stdio.h> void put_stars( int no ) while( no-- > 0 ) putchar( * ); --no > 0 int x; printf( input no: ); scanf( %d, &x ); put_stars( x ); 26 13

while( no-- > 0 ) putchar( * ); no : 5 4 3 2 1 no > 0 no-- no while( --no > 0 ) putchar( * ); no : 4 3 2 1 no-- no > 0 27 main 28 14

1x int kaijou( int x ) main kadai5-1.c for2 kadai5-2.c 32x3(A)3x2B kadai5-3.c A = 1 2 3 1 5 B = 5 3 4 5 6 8 1 29 4 5 30 15