double float

Size: px
Start display at page:

Download "double float"

Transcription

1 double float main Makefile

2 1 1 1) Makefile make Makefile 2) main 1 3) 4) main a) b) c) main d) main 1 enum { False, True } ; 2 void Usage ( ) { 3 puts ( Usage : ) 4 } 5 6 int main ( ) 7 { 8 int s f l a g=f a l s e ; 9 i f ( ) { 10 Usage ( ) ; 11 e x i t ( 1 ) ; 12 } 13 i f ( s? ) { 14 s f l a g=true ; / s / 15 } / / 18 } 5) 6) Segmentation Fault 7) C++ ( 2

3 2 C++ ) 8) gcc Wall O2 Wall O [ ] C,, #include <s t d i o. h> 2 int z =1; 3 4 void func ( int x ) 5 { 6 s t a t i c int y=8; 7 extern int z ; 8 p r i n t f ( %d,%d,%d\n, ( x)++,y++,z++); 9 } 10 int main ( void ) 11 { 12 int x=2, y=5, z =4; 13 func (&y ) ; 14 p r i n t f ( %d,%d,%d\n, x++,y++,z++); 15 func (&z ) ; 16 p r i n t f ( %d,%d,%d\n, x++,y++,z++); 17 return ( 0 ) ; 18 } 2 3

4 3 1 #include <s t d i o. h> 2 3 void func ( int n1, int np2 ) 4 { 5 n1= np2 ; 6 np2 =8; 7 np2=&n1 ; 8 } 9 10 int main ( void ) 11 { 12 int n1=0, n2 =5; 13 int np1, np2, tmp ; np1=&n2 ; 16 n2++; 17 tmp=&n1 ; 18 ( tmp)++; 19 np2=tmp ; 20 ( tmp)++; p r i n t f ( n1=%d, n2=%d, np1=%d, np2=%d\n, n1, n2, np1, np2 ) ; func ( np1, np2 ) ; 25 p r i n t f ( np1=%d, np2=%d\n, np1, np2 ) ; 26 } ( ) 1 #define MAX 10 const 1 const int MAX=10; #define const 4

5 3.2 double float 3 1) #define const 2 (#define const ) 1 #include <s t d i o. h> 2 #define MIN 2 3 int main ( void ) 4 { 5 p r i n t f ( %d,3/min ) ; 6 } 2) a #define 1 #include <s t d i o. h> 2 const int MAX=3; 3 int main ( void ) 4 { 5 int a [MAX], i ; 6 for ( i =0; i <MAX; i ++) a [ i ]=0; } 3.2 double float 1) double x= ) double float 3) 1 #include <s t d i o. h> 2 3 int main ( void ) 4 { 5 double x =0.0; 6 while ( 1 ) { 7 x+=0.1; 8 i f ( x==1.0) break ; 9 } 10 5

6 3.3 main 3 11 return ( 0 ) ; 12 } 4) x= x double float time ($ time <command name>) ) double float float float 3.3 main 1) showarg 1 $. / showarg a b c / showarg a b c 2) 2 ($./sum ) 2 1 $. / sum 1 2 Usage : sum <num1> <num2> main double atof() 3.4 1) n calloc int a[n] i < n a[ i]=i a [] array a) b) 6

7 5 2) n int a[n ][ n] a array2 4 1) mylib.c a) fropen Failed to open ( ) 1 FILE fropen ( char fname ) b) fwopen Failed to open 1 FILE fwopen ( char fname ) 2) mylib.c ( ) mylib.h 3) make clean.o Makefile 5 1) 0 1 genrand 100 (UNIX ) 2) getdist b) h (Usage) 1 $. / g e t d i s t h 2 Usage : g e t d i s t [ o p t ion ] < f i l e > 7

8 5 3 option : 4 h ) Show t h i s message 5 n ) with l i n e number 6... ( )... c) a d) g (, * ) : : : 4... #define e) n f) C gcc getopt getopt g) Usage h) mylib.c i) make getdist getdist Makefile 3) getdist.c FILE( ) result.dat FILE #ifdef 4) gcc, DFILE #define FILE make fgetdist getdist.c, fgetdist make getdist getdist Makefile 8

9 ) fropen ( ) frpopen, mylib.c, mylib.h 2) getdist getdist2 1 $ genrand 100 g e t d i s t 2 2 $ genrand 100 g e t d i s t 2 g 3 $ g e t d i s t 2 < f i l e name> 4 $ g e t d i s t 2 g < f i l e name> 5.2 1) ẋ = x a) b) (x(t)) e 2) ( d x dt y ) = ( ) ( x y a) b) ((x(t), y(t)) ) Makefile Makefile 9

10 6.1 Makefile 6 1 arg : arg. c # arg arg. c 2 gcc o arg arg. c # 3 4 mycat : mycat. c # mycat mycat. c 5 gcc o mycat mycat. c # Makefile # Makefile arg 1 $ make arg arg arg arg.c Makefile Makefile $ 1 GCC = gcc 2 CFLAGS= Wall O2 3 L o a d l i b s= lm # 4 5 main : main. o mycat. o # main main. o mycat. o 6 ${GCC} ${CFLAGS} o $@ main. o mycat. o ${ L o a d l i b s } 7 8 arg : arg. o # arg arg. o 9 ${GCC} ${CFLAGS} o $@ $@. o ${ L o a d l i b s } main. o : mycat. h main. c 12 ${GCC} ${CFLAGS} c o $@ main. c mycat. o : mycat. c 15 ${GCC} ${CFLAGS} c o $@ mycat. c c l e a n : 18 rm f. o 3 GCC, CFLAGS, Loadlibs ${GCC}, ${CFLAGS}, ${Loadlibs} 6 $@ 5 : ( main) 10

11 6.1 Makefile 6 make main Makefile main main.o mycat.o main.o main.o mycat.h, main.c main.o mycat.h main.c main.o main.o (.o) 1 $ make c l e a n Makefile Makefile 1 GCC = gcc 2 CFLAGS= Wall 3 L o a d l i b s= 4 5 main : main. o mycat. o 6 ${GCC} ${CFLAGS} o $@ main. o mycat. o ${ L o a d l i b s } 7 8 arg : arg. o 9 ${GCC} ${CFLAGS} o $@ $@. o ${ L o a d l i b s } main. o : mycat. h main. c c. o : 14 ${GCC} ${CFLAGS} c o $@ $< c l e a n : 17 rm f. o.c.o.c.o mycat.o mycat.c.c.o 1 mycat. o : mycat. c 2 ${GCC} ${CFLAGS} c o $@ $< $@ : mycat.o $< : mycat.c mycat.o main.o mycat.h main.c 11

12 6.2 6.c.o 6.2 C #define #define 1 #define MAX 100 MAX #define MAX 10 2 int main ( void ) 3 { 4 int i ; 5 char buf [MAX] ; 6 for ( i =0; i <MAX; i ++) buf [ i ]=0; 7 } ) x 1 #define s q r ( x ) ( ( x ) ( x ) ) () 2) 2 1 #define maxof ( x, y ) ( ( x>y )? x : y ) 3) 1 #define loop ( n ) for ( i =0; i <n;++ i ) 12

13 6.2 6 int i ; C++ OK 1 #define loop ( n ) for ( int i =0; i <n;++ i ) 4) 1 #define loop ( i, n ) for ( i =0; i <n;++ i ) #i f d e f #e l i f #endif #ifdef DEBUG 1 #define DEBUG 2 int main ( void ) 3 { 4 #i f d e f DEBUG 5 p r i n t f ( ) ; 6 #endif 7 } #ifndef 1 #ifndef 2... // 3 #endif 1 #i f == #e l i f == 2 13

14 #else #endif 6.3 UNIX ( data.txt) less 1 $ l e s s data. t x t main ( UNIX ) 1 $ cat data. t x t l e s s cat data.txt less cat less less data.txt int main ( int argc, char argv ) 3 { 4 char f i l e n a m e ; 5 FILE fp ; 6 7 f i l e n a m e=argv [ argc 1]; / / 8 9 i f ( f i l e n a m e [0]== argc==1 ) { / 1 f i l e n a m e 10 1 ( ) / 11 fp = s t d i n ; 12 } else { / / 13 fp = fopen ( filename, r ) ; 14 i f ( fp == NULL ) { 15 f p r i n t f ( s t d e r r, %s. \ n, f i l e n a m e ) ; 16 e x i t ( 1 ) ; / / 14

15 7 17 } 18 } } 7 1) nishii@sci.yamaguchi-u.ac.jp 2) 3) 15

第5回お試しアカウント付き並列プログラミング講習会

第5回お試しアカウント付き並列プログラミング講習会 qstat -l ID (qstat -f) qscript ID BATCH REQUEST: 253443.batch1 Name: test.sh Owner: uid=32637, gid=30123 Priority: 63 State: 1(RUNNING) Created at: Tue Jun 30 05:36:24 2009 Started at: Tue Jun 30 05:36:27

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

I J

I J I 065763J 8 7 7 31 jikken/ +----- accumulation_demupa.c +----- accumulation_rain.c +----- frequency_demupa.c +----- frequency_rain.c +----- go.sh +----- graph_maker.sh +----- mesure-ryudai/ 2007/4/1 2007/6/30

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

[ 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

新・明解C言語 実践編

新・明解C言語 実践編 第 1 章 見 21 1-1 見えないエラー 見 List 1-1 "max2x1.h" a, b max2 List 1-1 chap01/max2x1.h max2 "max2x1.h" #define max2(a, b) ((a) > (b)? (a) : (b)) max2 List 1-2 List 1-2 chap01/max2x1test.c max2 #include

More information

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

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 II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C 1 6 9 1 main main 1 NULL NULL 1 15 23 25 48 26 30 32 36 38 43 45 47 50 52 for 2 (a) 2 2 1 Yacc 2 (b) 2 3 yytext tmp2 ("") tmp2->next->word tmp2 yytext tmp2->next->word

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

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

橡Pro PDF

橡Pro PDF 1 void main( ) char c; /* int c; */ int sum=0; while ((c = getchar())!= EOF) if(isdigit(c) ) sum += (c-'0'); printf("%d\n", sum); main()int i,sum=0; for(i=0;i

More information

programmingII2019-v01

programmingII2019-v01 II 2019 2Q A 6/11 6/18 6/25 7/2 7/9 7/16 7/23 B 6/12 6/19 6/24 7/3 7/10 7/17 7/24 x = 0 dv(t) dt = g Z t2 t 1 dv(t) dt dt = Z t2 t 1 gdt g v(t 2 ) = v(t 1 ) + g(t 2 t 1 ) v v(t) x g(t 2 t 1 ) t 1 t 2

More information

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

(search: ) [1] ( ) 2 (linear search) (sequential search) 1 2005 11 14 1 1.1 2 1.2 (search:) [1] () 2 (linear search) (sequential search) 1 2.1 2.1.1 List 2-1(p.37) 1 1 13 n

More information

comment.dvi

comment.dvi ( ) (sample1.c) (sample1.c) 2 2 Nearest Neighbor 1 (2D-class1.dat) 2 (2D-class2.dat) (2D-test.dat) 3 Nearest Neighbor Nearest Neighbor ( 1) 2 1: NN 1 (sample1.c) /* -----------------------------------------------------------------

More information

memo

memo 数理情報工学演習第一 C プログラミング演習 ( 第 5 回 ) 2015/05/11 DEPARTMENT OF MATHEMATICAL INFORMATICS 1 今日の内容 : プロトタイプ宣言 ヘッダーファイル, プログラムの分割 課題 : 疎行列 2 プロトタイプ宣言 3 C 言語では, 関数や変数は使用する前 ( ソースの上のほう ) に定義されている必要がある. double sub(int

More information

Condition DAQ condition condition 2 3 XML key value

Condition DAQ condition condition 2 3 XML key value Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................

More information

プログラミング及び演習 第1回 講義概容・実行制御

プログラミング及び演習 第1回 講義概容・実行制御 プログラミング及び演習 第 12 回大規模プログラミング (2015/07/11) 講義担当情報連携統轄本部情報戦略室大学院情報科学研究科メディア科学専攻教授森健策 本日の講義 演習の内容 大きなプログラムを作る 教科書第 12 章 make の解説 プログラミングプロジェクト どんどんと進めてください 講義 演習ホームページ http://www.newves.org/~mori/15programming

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

ohp08.dvi

ohp08.dvi 19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data

More information

lexex.dvi

lexex.dvi (2018, c ) http://istksckwanseiacjp/ ishiura/cpl/ 4 41 1 mini-c lexc,, 2 testlexc, lexc mini-c 1 ( ) mini-c ( ) (int, char, if, else, while, return 6 ) ( ) (+, -, *, /, %, &, =, ==,!=, >, >=,

More information

main main Makefile Makefile C.5 Makefile Makefile Makefile A Mech (TA ) 1. Web (http://www.jsk.t.u-tokyo.ac.jp/ iku

main main Makefile Makefile C.5 Makefile Makefile Makefile A Mech (TA ) 1. Web (http://www.jsk.t.u-tokyo.ac.jp/ iku 2008 (mizuuchi@i.u-tokyo.ac.jp) http://www.jsk.t.u-tokyo.ac.jp/ http://www.jsk.t.u-tokyo.ac.jp/ ikuo/enshu/keisanki/ 2008 5 19 6 24 1 2 2.1 my_sound.c, my_sounc.h, play.c, record.c 2 2. 2.2 2.2.1 main

More information

yacc.dvi

yacc.dvi 2017 c 8 Yacc Mini-C C/C++, yacc, Mini-C, run,, Mini-C 81 Yacc Yacc, 1, 2 ( ), while ::= "while" "(" ")" while yacc 1: st while : lex KW WHILE lex LPAREN expression lex RPAREN statement 2: 3: $$ = new

More information

slide5.pptx

slide5.pptx ソフトウェア工学入門 第 5 回コマンド作成 1 head コマンド作成 1 早速ですが 次のプログラムを head.c という名前で作成してください #include #include static void do_head(file *f, long nlines); int main(int argc, char *argv[]) { if (argc!=

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°(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

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

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

More information

I 2 tutimura/ I 2 p.1/??

I 2   tutimura/ I 2 p.1/?? I 2 tutimura@mist.i.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/ 2002 4 25 I 2 p.1/?? / / Makefile I 2 p.2/?? Makefile make GNU make I 2 p.3/?? Makefile L A T E X I 2 p.4/?? core (1) gcc,

More information

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

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

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (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言語 ポインタ完全攻略

新・明解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

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

2 P.S.P.T. P.S.P.T. wiki  26 P.S.P.T. C 2011 4 10 2 P.S.P.T. P.S.P.T. wiki p.s.p.t.since1982@gmail.com http://www23.atwiki.jp/pspt 26 3 2 1 C 8 1.1 C................................................ 8 1.1.1...........................................

More information

P06.ppt

P06.ppt p.130 p.198 p.208 2 1 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]: weight 3 maxof(a,

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() 2 double *a[ ]; double 1 malloc() double 1 malloc() free() 3 #include #include

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (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

untitled

untitled H8/300,H8S,H8SX [H8S,H8/300 Tool Chain Ver6.2.0.0] #define Inline static inline //************************************************** Inline char sil_and_mem(char *mem,char and) return (*((volatile

More information

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

t 2 2 t 2 t F ( ) p- 2 2 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 2 1 2 2 0 1 2 2 2 2 2 2 2 2.1 2 2 F={f ij }, G {g ij } t f ij t g ij = 1 f ij < t g ij = 0 t p- p S 0 S p = S 0 /S t p 2 t 1 t 2 2 t 2 t 2 2 3 3 1 2 F ( ) p- 2 2 F 2 G 3 2 2 F ( ) 2 2 F 2 G 3 3 2 F ( ) 2

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() malloc 2 #include #include #include enum LENGTH = 10 ; int

More information

解きながら学ぶC++入門編

解きながら学ぶC++入門編 !... 38!=... 35 "... 112 " "... 311 " "... 4, 264 #... 371 #define... 126, 371 #endif... 369 #if... 369 #ifndef... 369 #include... 3, 311 #undef... 371 %... 17, 18 %=... 85 &... 222 &... 203 &&... 40 &=...

More information

ARM gcc Kunihiko IMAI 2009 1 11 ARM gcc 1 2 2 2 3 3 4 3 4.1................................. 3 4.2............................................ 4 4.3........................................

More information

Smalltalk_

Smalltalk_ DLLCC VisualWorks C Mac OS SSK-LampControl/ VisualWorksWithJun SSK-LampControl.h include SSK SSK FileBrowser SSK-LampControl.st FIle in SSK-LampControl File in SSK File in ( Smalltalk.SSK) ( C ) Controller

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

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

memo

memo 数理情報工学演習第一 C ( 第 8 回 ) 206/06/3 DEPARTMENT OF MATHEMATICAL INFORMATICS 今日の内容 : プロトタイプ宣言 ヘッダーファイル, プログラムの分割 プライオリティキュー ヒープ 課題 : ヒープソート 2 プロトタイプ宣言 C 言語では, 関数や変数は使用する前 ( ソースの上のほう ) に定義されている必要がある. double sub(int

More information

P05.ppt

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

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

分割コンパイル (2018 年度 ) 担当 : 笹倉 佐藤 分割コンパイルとは 一つのプログラムのソースを複数のソースファイルに分けてコンパイルすること ある程度大きなプログラムの場合ソースファイルをいくつかに分割して開発するのが普通 1

分割コンパイル (2018 年度 ) 担当 : 笹倉 佐藤 分割コンパイルとは 一つのプログラムのソースを複数のソースファイルに分けてコンパイルすること ある程度大きなプログラムの場合ソースファイルをいくつかに分割して開発するのが普通 1 分割コンパイル (2018 年度 ) 担当 : 笹倉 佐藤 2018.12.20 分割コンパイルとは 一つのプログラムのソースを複数のソースファイルに分けてコンパイルすること ある程度大きなプログラムの場合ソースファイルをいくつかに分割して開発するのが普通 1 なぜ分割コンパイルするのか 1. コンパイル時間を短縮するため 2. ソースコードを見やすくするため 3. ソースコードを再利用しやすくするため

More information

プログラミング及び演習 第1回 講義概容・実行制御

プログラミング及び演習 第1回 講義概容・実行制御 プログラミング及び演習 第 12 回大規模プログラミング (2017/07/15) 講義担当大学院情報学研究科知能システム学専攻教授森健策大学院情報学研究科知能システム科学専攻助教小田昌宏 本日の講義 演習の内容 大きなプログラムを作る 教科書第 12 章 make の解説 プログラミングプロジェクト どんどんと進めてください 講義 演習ホームページ http://www.newves.org/~mori/17programming

More information

Microsoft PowerPoint - kougi9.ppt

Microsoft PowerPoint - kougi9.ppt C プログラミング演習 第 9 回ポインタとリンクドリストデータ構造 1 今まで説明してきた変数 #include "stdafx.h" #include int _tmain(int argc, _TCHAR* argv[]) { double x; double y; char buf[256]; int i; double start_x; double step_x; FILE*

More information

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

ex14.dvi

ex14.dvi 1,, 0, b (b b 2 b ) n k n = n j b j, (0 n j b 1), n =(n k n k 1...n 1 n 0 ) b, n j j j +1, 0,...,b 1 (digit). b b, n b 1 ñ, ñ = k (b 1 n j )b j b N, n b n, n = b N n, n =ñ+1 b N, n m n + m (mod b N ),

More information

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose

filea fileb fp = fopen(a, r); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen(b, r); while(fgets(line, BUFSIZ, fp)) {... fclose I117 9 2 School of Information Science, Japan Advanced Institute of Science and Technology file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line,

More information

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧)

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧) CM-3G 周辺モジュール拡張技術文書 MS5607 センサ ( 温度 気圧 ) ( 第 1 版 ) Copyright (C)2016 株式会社コンピューテックス 目次 1. はじめに... 1 2. MS5607 について... 1 3. 接続図... 1 4. アプリケーション ソース... 2 5. アプリケーションのコンパイル方法... 7 6. アプリケーションの実行... 8 1. はじめに

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

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

untitled

untitled Q 8 1 8.1 (C++) C++ cin cout 5 C++ 16 6 p.63 8.3 #include 7 showbase noshowbase showpoint noshowpoint 8.3 uppercase 16 nouppercase 16 setfill(int) setprecision(int) setw(int) setbase(int) dec

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

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

G1. tateyama~$ gcc -c xxxxx.c ( ) xxxxx.o tateyama~$ gcc -o xxxxx.o yyyyy.o..... zzzzz.o Makefile make Makefile : xxxxx.o yyyyy.o... zzzzz.o ; gcc -o

G1. tateyama~$ gcc -c xxxxx.c ( ) xxxxx.o tateyama~$ gcc -o xxxxx.o yyyyy.o..... zzzzz.o Makefile make Makefile : xxxxx.o yyyyy.o... zzzzz.o ; gcc -o G1. tateyama~$ gcc -c xxxxx.c ( ) xxxxx.o tateyama~$ gcc -o xxxxx.o yyyyy.o..... zzzzz.o Makefile make Makefile : xxxxx.o yyyyy.o... zzzzz.o ; gcc -o xxxxx.o yyyyy.o... zzzzz.o [1] [5] 1 [1] (matrix multi

More information

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h> 2007 12 5 1 2 2.1 ( ) 1 1: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define H WIN 400 // 8 #define W WIN 300 // 9

More information

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l C/C++ 2007 6 18 1 C STL(1) 2 1.1............................................... 2 1.2 stdio................................................ 3 1.3.......................................... 10 2 11 2.1 sizeof......................................

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D 6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet

More information

p = 1, 2, cos 2n + p)πj = cos 2nπj 2n + p)πj, sin = sin 2nπj 7.1) f j = a ) 0 + a p + a n+p cos 2nπj p=1 p=0 1 + ) b n+p p=0 sin 2nπj 1 2 a 0 +

p = 1, 2, cos 2n + p)πj = cos 2nπj 2n + p)πj, sin = sin 2nπj 7.1) f j = a ) 0 + a p + a n+p cos 2nπj p=1 p=0 1 + ) b n+p p=0 sin 2nπj 1 2 a 0 + 7 7.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave T > 0 t 44.1 khz t = 1 44100 j t f j {f 0, f 1, f 2,, f 1 = T t 7.2 T {f 0, f 1, f 2,, f 1 T ft) f j = fj t) j = 0, 1,

More information

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( ) L09 IP (2017) 1 / 28

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( )   L09 IP (2017) 1 / 28 L09(2017-11-21 Tue) : Time-stamp: 2017-11-21 Tue 14:52 JST hig TCP/IP. IP,,,. http://hig3.net L09 (2017) 1 / 28 9, IP, - L09 (2017) 2 / 28 C (ex. ) 1 TCP/IP 2 3 ( ) ( L09 (2017) 3 / 28 50+5, ( )50+5. (

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

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

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B A/B (2010/10/08) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2010/soft/soft.html 2010 10 8 A/B 1 2010 10 8 2 1 1 1.1 OHP.................................... 1 1.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

2 1. Ubuntu 1.1 OS OS OS ( OS ) OS ( OS ) VMware Player VMware Player jp/download/player/ URL VMware Plaeyr VMware

2 1. Ubuntu 1.1 OS OS OS ( OS ) OS ( OS ) VMware Player VMware Player   jp/download/player/ URL VMware Plaeyr VMware 1 2010 k-okada@jsk.t.u-tokyo.ac.jp http://www.jsk.t.u-tokyo.ac.jp/~k-okada/lecture/ 2010 4 5 Linux 1 Ubuntu Ubuntu Linux 1 Ubuntu Ubuntu 3 1. 1 Ubuntu 2. OS Ubuntu OS 3. OS Ubuntu https://wiki.ubuntulinux.jp/ubuntutips/install/installdualboot

More information

[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

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

2008 ( 13 ) C LAPACK 2008 ( 13 )C LAPACK p. 1

2008 ( 13 ) C LAPACK 2008 ( 13 )C LAPACK p. 1 2008 ( 13 ) C LAPACK LAPACK p. 1 Q & A Euler http://phase.hpcc.jp/phase/mppack/long.pdf KNOPPIX MT (Mersenne Twister) SFMT., ( ) ( ) ( ) ( ). LAPACK p. 2 C C, main Asir ( Asir ) ( ) (,,...), LAPACK p.

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

第3章 OpenGL の基礎

第3章 OpenGL の基礎 3 OpenGL April 20, 2012 1 / 23 31 ( ) OpenGL OpenGL 2 / 23 32 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh CAD

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

第3章 OpenGL の基礎

第3章 OpenGL の基礎 3 OpenGL April 11, 2017 1 / 28 3.1 ( ) OpenGL OpenGL 2 / 28 3.2 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc. 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

BW BW

BW BW Induced Sorting BW 11T2042B 2015 3 23 1 1 1.1................................ 1 1.2................................... 1 2 BW 1 2.1..................................... 2 2.2 BW.................................

More information

6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = N t N 44.1 khz t = 1 sec j t f j {f 0, f 1, f 2,, f N 1

6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = N t N 44.1 khz t = 1 sec j t f j {f 0, f 1, f 2,, f N 1 6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = t 44.1 khz t = 1 sec 44100 j t f j {f 0, f 1, f 2,, f 1 6.2 T {f 0, f 1, f 2,, f 1 T ft) f j = fj t) j = 0, 1, 2,,

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

スライド タイトルなし

スライド タイトルなし ファイル入出力 (2) これまでのおさらい ( 入出力 ) これまでの入出力は 入力 scanf 出力 printf キーボードと画面 ( 端末 ) scanf/printf は 書式つき入出力 フォーマットを指定する 標準入出力を対象とする 何もしなければ 標準入出力は キーボードと画面 ストリームという考え方 ストリーム (stream) = データの列 キーボードから打つ文字列 画面に出力される文字列

More information

Makefile, TCPソケットサーバ, コマンドライン引数

Makefile, TCPソケットサーバ, コマンドライン引数 L11(2017-12-12 Tue) : Time-stamp: 2017-12-22 Fri 12:28 JST hig ( ) make http://hig3.net L11 (2017) 1 / 24 I, void die(char message) void die(char message[])... 1 #i n c l u d e 2 / / 3 double

More information

新コンフィギュレータのフレームワークについて

新コンフィギュレータのフレームワークについて : 2007 12 7 6: 2009 5 9 TOPPERS 1.... 4 1.1... 4 1.2 TOPPERS... 4 2.... 4 2.1... 4 3.... 8 4.... 9 4.1... 9 4.2... 10 4.3... 10 4.3.1... 11 4.3.2 INCLUDE... 11 4.3.3 C... 12 4.4 API... 14 4.2.1 API...

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

44 6 MPI 4 : #LIB=-lmpich -lm 5 : LIB=-lmpi -lm 7 : mpi1: mpi1.c 8 : $(CC) -o mpi1 mpi1.c $(LIB) 9 : 10 : clean: 11 : -$(DEL) mpi1 make mpi1 1 % mpiru

44 6 MPI 4 : #LIB=-lmpich -lm 5 : LIB=-lmpi -lm 7 : mpi1: mpi1.c 8 : $(CC) -o mpi1 mpi1.c $(LIB) 9 : 10 : clean: 11 : -$(DEL) mpi1 make mpi1 1 % mpiru 43 6 MPI MPI(Message Passing Interface) MPI 1CPU/1 PC Cluster MPICH[5] 6.1 MPI MPI MPI 1 : #include 2 : #include 3 : #include 4 : 5 : #include "mpi.h" 7 : int main(int argc,

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

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

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

SystemC言語概論

SystemC言語概論 SystemC CPU S/W 2004/01/29 4 SystemC 1 SystemC 2.0.1 CPU S/W 3 ISS SystemC Co-Simulation 2004/01/29 4 SystemC 2 ISS SystemC Co-Simulation GenericCPU_Base ( ) GenericCPU_ISS GenericCPU_Prog GenericCPU_CoSim

More information

Microsoft Word - Training10_プリプロセッサ.docx

Microsoft Word - Training10_プリプロセッサ.docx Training 10 プリプロセッサ 株式会社イーシーエス出版事業推進委員会 1 Lesson1 マクロ置換 Point マクロ置換を理解しよう!! マクロ置換の機能により 文字列の置き換えをすることが出来ます プログラムの可読性と保守性 ( メンテナンス性 ) を高めることができるため よく用いられます マクロ置換で値を定義しておけば マクロの値を変更するだけで 同じマクロを使用したすべての箇所が変更ができるので便利です

More information

エラー処理・分割コンパイル・コマンドライン引数

エラー処理・分割コンパイル・コマンドライン引数 L10(2017-12-05 Tue) : Time-stamp: 2017-12-17 Sun 11:59 JST hig. recv/send http://hig3.net ( ) L10 (2017) 1 / 21 IP I swallow.math.ryukoku.ac.jp:13 = 133.83.83.6:13 = : IP ( = ) (well-known ports), :. :,.

More information

O(N) ( ) log 2 N

O(N) ( ) log 2 N 2005 11 21 1 1.1 2 O(N) () log 2 N 1.2 2 1 List 3-1 List 3-3 List 3-4? 3 3.1 3.1.1 List 2-1(p.70) 1 1 10 1 3.1.2 List 3-1(p.70-71) 1 1 2 1 2 2 1: 1 3 3.1.3 1 List 3-1(p.70-71) 2 #include stdlib.h

More information

1. 入力した正の整数を降順に並べ換えて出力するプログラムを作成せよ プログラムは個別にコンパイルし make コマンドで実行すること 入力データは 50 以下とし 以下の数が混在しているとする 16 進数 : 先頭 1 文字が x または X( エックスの小文字か大文字 ) 8 進数 : 先頭 1

1. 入力した正の整数を降順に並べ換えて出力するプログラムを作成せよ プログラムは個別にコンパイルし make コマンドで実行すること 入力データは 50 以下とし 以下の数が混在しているとする 16 進数 : 先頭 1 文字が x または X( エックスの小文字か大文字 ) 8 進数 : 先頭 1 1. 入力した正の整数を降順に並べ換えて出力するプログラムを作成せよ プログラムは個別にコンパイルし make コマンドで実行すること 入力データは 50 以下とし 以下の数が混在しているとする 16 進数 : 先頭 1 文字が x または X( エックスの小文字か大文字 ) 8 進数 : 先頭 1 文字が 0( 零 ) 10 進数 : 先頭 1 文字が 0( 零 ) 以外の数字 1.1 プログラム

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 - CproNt02.ppt [互換モード]

Microsoft PowerPoint - CproNt02.ppt [互換モード] 第 2 章 C プログラムの書き方 CPro:02-01 概要 C プログラムの構成要素は関数 ( プログラム = 関数の集まり ) 関数は, ヘッダと本体からなる 使用する関数は, プログラムの先頭 ( 厳密には, 使用場所より前 ) で型宣言 ( プロトタイプ宣言 ) する 関数は仮引数を用いることができる ( なくてもよい ) 関数には戻り値がある ( なくてもよい void 型 ) コメント

More information