I J

Size: px
Start display at page:

Download "I J"

Transcription

1 I J

2 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/ / _csv.log 18GHz _csv.log 26GHz _rain.csv / : : per_min_rain.c ten.c (18GHz) ten2.c (26GHz) 18GHz csv.log 10 (ten.c) #include<stdio. h> #include<s tdlib. h> #include<string. h> #define MAXBUF 128 enum edata{ TIME H, TIME M, TIME S, MX LEVEL, MXPOWER, MX BER, DATAMAX ; int main( int argc, char argv [ ] ) { FILE fp, fp r = fopen ( argv [ 1 ], r ) ; char buf [MAXBUF], file name ; int i, j, k, data [DATAMAX], current [DATAMAX], pre [DATAMAX], check ; i f ( fp r == NULL) { printf ( : %s \n, argv [ 1 ] ) ; file name = malloc ( sizeof (char) ( strlen ( ten ) + strlen ( argv [ 1 ] ) ) ) ; strcpy ( file name, ten ) ; strcat ( file name, argv [ 1 ] ) ; fp = fopen ( file name, r ) ; printf ( %s \n, file name ) ; // for ( i=time H; i<datamax; ++i ) { data [ i ] = 0; pre [ i ] = 0; current [ i ] = 0; // for ( i =1,k=0; fgets ( buf, MAX BUF, fp r ) ; ++i ) { i f ( i < 3) continue ; //

3 // sscanf ( buf, %d:%d:%d,%d,%d,%d\n, &current [TIME H], &current [TIME M], &current [TIME S], &current [MX LEVEL], &current [MXPOWER], &current [MX BER] ) ; i f ( pre [TIME H] == current [TIME H] ) { // i f ( pre [TIME M] == current [TIME M] ) { // i f ( pre [TIME S]/10 == current [TIME S]/10) { // for ( j=time H; j<datamax; ++j ) { data [ j ] += current [ j ] ; pre [ j ] = current [ j ] ; ++k ; // continue ; // fp = fopen ( file name, a ) ; check = f p r i n t f ( fp, %02d:%02d:%02d,%d,%d,%d\n, data [TIME H]/k, data [TIME M]/k, (( data [TIME S]/k)/10) 10, data [MX LEVEL]/k, data [MXPOWER]/k, data [MXBER]/k ) ; check>0? printf ( ) : printf ( ) ; // for ( j=time H; j<datamax; ++j ) { pre [ j ] = current [ j ] ; data [ j ] = current [ j ] ; k = 1; // data current // fp = fopen ( file name, a ) ; check = f p r i n t f ( fp, %02d:%02d:%02d,%d,%d,%d\n, data [TIME H]/k, data [TIME M]/k, (( data [TIME S]/k)/10) 10, data [MX LEVEL]/k, data [MXPOWER]/k, data [MXBER]/k ) ; check>0? printf ( ) : printf ( ) ; // ten.c GHz csv.log 10 (ten2.c) #include<stdio. h> #include<s tdlib. h> #include<string. h> #define MAXBUF 128 enum edata{ TIME H, TIME M, TIME S, MX LEVEL, MXPOWER, MX BER1, MX BER2, DATAMAX ; int main( int argc, char argv [ ] ) { FILE fp, fp r = fopen ( argv [ 1 ], r ) ; char buf [MAXBUF], file name ; int i, j, k, data [DATAMAX], current [DATAMAX], pre [DATAMAX], check ; i f ( fp r == NULL) { printf ( : %s \n, argv [ 1 ] ) ; file name = malloc ( sizeof (char) ( strlen ( ten ) + strlen ( argv [ 1 ] ) ) ) ; strcpy ( file name, ten ) ;

4 strcat ( file name, argv [ 1 ] ) ; fp = fopen ( file name, r ) ; printf ( %s \n, file name ) ; // for ( i=time H; i<datamax; ++i ) { data [ i ] = 0; pre [ i ] = 0; current [ i ] = 0; // for ( i =1,k=0; fgets ( buf, MAX BUF, fp r ) ; ++i ) { i f ( i < 3) continue ; // // sscanf ( buf, %d:%d:%d,%d,%d,%d,%d\n, &current [TIME H], &current [TIME M], &current [TIME S], &current [MX LEVEL], &current [MXPOWER], &current [MX BER1], &current [MX BER2] ) ; i f ( pre [TIME H] == current [TIME H] ) { // i f ( pre [TIME M] == current [TIME M] ) { // i f ( pre [TIME S]/10 == current [TIME S]/10) { // for ( j=time H; j<datamax; ++j ) { data [ j ] += current [ j ] ; pre [ j ] = current [ j ] ; ++k ; // continue ; // fp = fopen ( file name, a ) ; check = f p r i n t f ( fp, %02d:%02d:%02d,%d,%d,%d,%d\n, data [TIME H]/k, data [TIME M]/k, (( data [TIME S]/k)/10) 10, data [MX LEVEL]/k, data [MXPOWER]/k, data [MX BER1]/k, data [MX BER2]/k ) ; check>0? printf ( ) : printf ( ) ; for ( j=time H; j<datamax; ++j ) { pre [ j ] = current [ j ] ; data [ j ] = current [ j ] ; k = 1; // data current // fp = fopen ( file name, a ) ; check = f p r i n t f ( fp, %02d:%02d:%02d,%d,%d,%d,%d\n, data [TIME H]/k, data [TIME M]/k, (( data [TIME S]/k)/10) 10, data [MX LEVEL]/k, data [MXPOWER]/k, data [MX BER1]/k, data [MX BER2]/k ) ; check>0? printf ( ) : printf ( ) ; ten.c ten.c

5 1 1 (per min rain.c) / / #include<stdio. h> #include<s tdlib. h> #include<string. h> #define MAXBUF 128 int main( int argc, char argv [ ] ) { FILE fp, fp r = fopen ( argv [ 1 ], r ) ; char buf [MAXBUF], p ; int i, j =0, ave [ 2 4 ], sum=0, check, err num=0; / h rain. t x t / fp = fopen ( h rain. txt, r ) ; puts ( h rain. txt ) ; for ( i= 2; fgets ( buf, MAX BUF, fp r ) ; ++i ) { i f ( i <0) continue ; / / i f ( i <60) { p = strtok ( buf,, ) ; p = strtok (NULL,, ) ; sum += atoi (p ) ; continue ; ave [ j ] = sum; / / ++j ; sum = 0; i = 0; ave [ j ] = sum; / / / / fp = fopen ( h rain. txt, w ) ; for ( j =0; j <24; ++j ) { check = f p r i n t f ( fp, %d\n, ave [ j ] ) ; check>0? / / : ++err num ; / / / / err num == 0? printf ( ) : printf ( ) ; csv.log 3 (ten.c, ten2.c, per min rain.c) (go.sh) #! bin/sh cd./ mesure ryudai /; dir num= l s 1 wc l dir num= expr $dir num + 0 l i s t = ls count=1 for dir in $ l i s t ; do i f [ d $dir ] ; then cd./ $dir ; r a i n f i l e = l s rain. csv echo echo $dir [ $count / $dir num ] ; i f [ f $f ] ; then check =.. /.. / ten csv. log echo ten > $check

6 f i cd.. / check =.. /.. / ten csv. log echo ten > $check check =.. /.. / per min rain $ r a i n f i l e echo $ r a i n f i l e > $check f i count= expr $count + 1 done go.sh % sh go.sh [ 1 / 91 ] ten_ > ten_ > _rain.csv ---> [ 2 / 91 ] ten_ > ten_ > _rain.csv ---> [ 3 / 91 ] ten_ > ten_ > _rain.csv ---> [ 4 / 91 ] ten_ > ten_ > _rain.csv ---> [ 88 / 91 ] ten_ > ten_ > _rain.csv ---> [ 89 / 91 ] ten_ > ten_ > _rain.csv ---> [ 90 / 91 ] ten_ > ten_ > _rain.csv ---> [ 91 / 91 ] ten_ > ten_ > _rain.csv ---> 18GHz, 26GHz 1 1

7 (frequency rain.c) / / / / #include<stdio. h> #include<s tdlib. h> #define MAXNUM #define MAXBUF 32 #define WIDTH 1 / / int check rank ( int ) ; int main( int argc, char argv [ ] ) { FILE fp, fp r ; int array [MAXNUM], i, max rank=0, check, write check, f l a g =0; char buf [MAXBUF] ; fp = fopen ( frequency rain. txt, r ) ; puts ( frequency rain. txt ) ; for ( i =0; i<maxnum; ++i ) array [ i ] = 0; / / for ( i =1; i<argc ; ++i ) { fp r = fopen ( argv [ i ], r ) ; i f ( fp r == NULL) { printf ( %s \n, argv [ i ] ) ; while( fgets ( buf, MAX BUF, fp r ) ) { check = check rank ( atoi ( buf ) ) ; / check rank () / ++(array [ check ] ) ; i f ( check > max rank) max rank = check ; f c l o s e ( fp r ) ; fp = fopen ( frequency rain. txt, w ) ; for ( i =0; i<=max rank ; ++i ) { write check = f p r i n t f ( fp, %d %d %d %d\n, i WIDTH, array [ i ], i WIDTH, i WIDTH+WIDTH) ; i f ( write check <0) f l a g =1; f l a g? printf ( \n ) : printf ( \n ) ; / / int check rank ( int num) { static int pre ; / / int j, k ; i f ( pre WIDTH <= num && num <= ( pre WIDTH)+WIDTH 1) return pre ; / / j = k = pre ; j ; ++k ; for ( ; ; ) { / / i f ( j>=0) { / j / i f ( j WIDTH <= num && num <= ( j WIDTH)+WIDTH 1) { / j / pre = j ; return j ; else / j / j ; / j j / i f (k WIDTH <= num && num <= (k WIDTH)+WIDTH 1) { / k / pre = k ; return k ; else / k / ++k ; return 1;

8 check rank() a b c d (1 ) check rank() (accumulation rain.c) / / / / #include<stdio. h> #include<s tdlib. h> #define MAXBUF 32 int main( int argc, char argv [ ] ) { FILE fp, fp r = fopen ( argv [ 1 ], r ) ; char buf [MAXBUF] ; double data, accum, max num=0; int i, j, line max, width, trash, write check, f l a g =0; i f ( argc!= 3) { puts ( ) ; i f ( fp r == NULL) { printf ( %s \n, argv [ 1 ] ) ; fp = fopen ( accumulation rain. txt, r ) ; puts ( accumulation rain. txt ) ; line max = atoi ( argv [ 2 ] ) ; / / data = malloc ( sizeof (double) line max ) ; / / accum = malloc ( sizeof (double) line max ) ; for ( i =0; fgets ( buf, MAX BUF, fp r ) ; ++i ) { i f ( i==0) { / / sscanf ( buf, %d %l f %d %d\n, &trash, &data [ i ], &trash, &width ) ; max num += data [ i ] ; / / accum [ i ] = 0; / / else { / / sscanf ( buf, %d %l f %d %d\n, &trash, &data [ i ], &trash, &trash ) ; max num += data [ i ] ; f c l o s e ( fp r ) ; for ( i =0, j=line max 1; i<line max ; ++i, j ) { / / i f ( i==0) { accum [ i ] = data [ j ] ; continue ; accum [ i ] = accum [ i 1] + data [ j ] ; fp = fopen ( accumulation rain. txt, w ) ; for ( i =0, j=line max 1; i<line max ; ++i, j ) { i f ( data [ i ] == 0) continue ; write check = f p r i n t f ( fp, %l f %d\n, (accum [ i ]/max num) 100, j width ) ; i f ( write check <0) f l a g =1; f l a g? printf ( \n ) : printf ( \n ) ;

9 (frequency demupa.c) / / / / #include<stdio. h> #include<s tdlib. h> #include<string. h> #define MAXNUM 512 #define MAXBUF 32 #define WIDTH 1 / / int check rank ( int ) ; int main( int argc, char argv [ ] ) { FILE fp, fp r ; int array18m [MAXNUM], array18p [MAXNUM], array26m [MAXNUM], array26p [MAXNUM], i, max rank18 m=0, max rank18 p=0, max rank26 m=0, max rank26 p=0, check, trash, val, write check, f l a g =0; char buf [MAXBUF] ; / / fp = fopen ( frequency demupa 18GHz. txt, r ) ; puts ( frequency demupa 18GHz. txt ) ; fp = fopen ( frequency demupa 26GHz. txt, r ) ; puts ( frequency demupa 26GHz. txt ) ; / / for ( i =0; i<maxnum; ++i ) { array18m [ i ] = 0; / 18GHz (Minus) / array18p [ i ] = 0; / 18GHz / array26m [ i ] = 0; / 26GHz / array26p [ i ] = 0; / 26GHz ( Plus ) / / / for ( i =1; i<argc ; ++i ) { fp r = fopen ( argv [ i ], r ) ; i f ( fp r == NULL) { printf ( %s \n, argv [ i ] ) ; / 18GHz / i f ( s t r s t r ( argv [ i ], ten csv. log ) ) { while( fgets ( buf, MAX BUF, fp r ) ) { sscanf ( buf, %d:%d:%d,%d,%d,%d\n, / trash / &trash, &trash, &trash, &val, &trash, &trash ) ; i f ( val < 0) val += 256; val = val/2 121; / val check rank () / i f ( val >= 0) { check = check rank ( val ) ; ++(array18p [ check ] ) ; / val / i f ( check > max rank18 p) max rank18 p = check ; continue ; / / / val check rank () / check = check rank ( val 1 ) ; ++(array18m [ check ] ) ; / val / i f ( check > max rank18 m) max rank18 m = check ; / 26GHz / i f ( s t r s t r ( argv [ i ], ten csv. log ) ) { while( fgets ( buf, MAX BUF, fp r ) ) { sscanf ( buf, %d:%d:%d,%d,%d,%d,%d\n, &trash, &trash, &trash, &val, &trash, &trash, &trash ) ; i f ( val < 0) val += 256; val = val/2 121; i f ( val >= 0) {

10 check = check rank ( val ) ; ++(array26p [ check ] ) ; i f ( check > max rank26 p) max rank26 p = check ; continue ; check = check rank ( val 1 ) ; ++(array26m [ check ] ) ; i f ( check > max rank26 m) max rank26 m = check ; f c l o s e ( fp r ) ; / 18GHz / fp = fopen ( frequency demupa 18GHz. txt, w ) ; i f (max rank18 p!= 0) { for ( i =0; i<=max rank18 p ; ++i ) { write check = f p r i n t f ( fp, %d %d %d %d\n, i WIDTH, array18p [ i ], i WIDTH, i WIDTH+WIDTH) ; i f ( write check <0) f l a g = 1; for ( i =1; i<=max rank18 m ; ++i ) { write check = f p r i n t f ( fp, %d %d %d %d\n, i WIDTH 1, array18m [ i ], i WIDTH 1, ( i WIDTH+WIDTH) 1); i f ( write check <0) f l a g = 1; f l a g? printf ( ) : printf ( ) ; f l a g = 0; / 26GHz / fp = fopen ( frequency demupa 26GHz. txt, w ) ; i f (max rank26 p!= 0) { for ( i =0; i<=max rank26 p ; ++i ) { write check = f p r i n t f ( fp, %d %d %d %d\n, i WIDTH, array26p [ i ], i WIDTH, i WIDTH+WIDTH) ; i f ( write check <0) f l a g = 1; for ( i =1; i<=max rank26 m ; ++i ) { write check = f p r i n t f ( fp, %d %d %d %d\n, i WIDTH 1, array26m [ i ], i WIDTH 1, ( i WIDTH+WIDTH) 1); i f ( write check <0) f l a g = 1; f l a g? printf ( \n ) : printf ( \n ) ; / / int check rank ( int num) { static int pre ; / / int j, k ; i f ( pre WIDTH <= num && num <= ( pre WIDTH)+WIDTH 1) return pre ; / / j = k = pre ; j ; ++k ; for ( ; ; ) { / / i f ( j>=0) { / j / i f ( j WIDTH <= num && num <= ( j WIDTH)+WIDTH 1) { / j / pre = j ; return j ; else / j / j ; / j j / i f (k WIDTH <= num && num <= (k WIDTH)+WIDTH 1) { / k / pre = k ; return k ; else / k / ++k ; return 1;

11 check rank() -1-1 (accumulation demupa.c) / / / / #include<stdio. h> #include<s tdlib. h> #include<string. h> #define MAXBUF 32 int main( int argc, char argv [ ] ) { FILE fp, fp r = fopen ( argv [ 1 ], r ) ; char buf [MAXBUF] ; double arraym, arrayp, accump, accumm, temp, max num=0; int i, j, p, m, line max, width1, width2, sign, trash, check, f l a g =0; i f ( argc!= 3) { puts ( ) ; i f ( fp r == NULL) { printf ( %s \n, argv [ 1 ] ) ; i f ( s t r s t r ( argv [ 1 ], frequency demupa 18GHz. txt )) { fp = fopen ( accumulation demupa 18GHz. txt, r ) ; puts ( accumulation demupa 18GHz. txt ) ; else i f ( s t r s t r ( argv [ 1 ], frequency demupa 26GHz. txt )) { fp = fopen ( accumulation demupa 26GHz. txt, r ) ; puts ( accumulation demupa 26GHz. txt ) ; line max = atoi ( argv [ 2 ] ) ; / / arraym = malloc ( sizeof (double) line max ) ; / / arrayp = malloc ( sizeof (double) line max ) ; for ( i =0,p=0,m=0; fgets ( buf, MAX BUF, fp r ) ; ++i ) { i f ( i==0) { / / sscanf ( buf, %d %l f %d %d\n, &sign, &temp, &width1, &width2 ) ; i f ( sign >= 0) { / / arrayp [ p ] = temp ; ++p ; else { / / arraym [m] = temp ; ++m; max num += temp ; else { / / sscanf ( buf, %d %l f %d %d\n, &sign, &temp, &trash, &trash ) ; i f ( sign >= 0) { arrayp [ p ] = temp ; ++p ; else { arraym [m] = temp ; ++m; max num += temp ;

12 f c l o s e ( fp r ) ; width1 = abs (width2 width1 ) ; / / accump = malloc ( sizeof (double) p ) ; accumm = malloc ( sizeof (double) m) ; for ( i =0, j=p 1; i<p ; ++i, j ) { / / i f ( i==0) { accump [ i ] = arrayp [ j ] ; continue ; accump [ i ] = accump [ i 1] + arrayp [ j ] ; for ( i =0, j=m 1; i<m; ++i, j ) { / / i f ( i==0) { accumm[ i ] = arraym [ i ] ; continue ; accumm[ i ] = accumm[ i 1] + arraym [ i ] ; / / i f ( s t r s t r ( argv [ 1 ], frequency demupa 18GHz. txt )) { fp = fopen ( accumulation demupa 18GHz. txt, w ) ; else i f ( s t r s t r ( argv [ 1 ], frequency demupa 26GHz. txt )) { fp = fopen ( accumulation demupa 26GHz. txt, w ) ; / / for ( i =0, j=p ; i<p ; ++i, j ) { i f ( arrayp [ i ] == 0) continue ; check = f p r i n t f ( fp, %l f %d\n, (accump [ i ]/max num) 100, j width1 ) ; for ( i =0, j=m; i<m; ++i, j ) { i f (arraym [ i ] == 0) continue ; check = f p r i n t f ( fp, %l f %d\n, (accumm[ i ]/max num) 100, f l a g? printf ( \n ) : printf ( \n ) ; i width1 1); / / for( p ; p>=0; p) { i f ( arrayp [ p ] == 0) continue ; check = f p r i n t f ( fp, %l f %d\n, ( arrayp [ p]/max num) 100, p width ) ; i f ( check<0) f l a g = 1; for ( i =0; i<=m; ++i ) { i f (arraym [ i ] == 0) continue ; check = f p r i n t f ( fp, %l f %d\n, (arraym [ i ]/max num) 100, i width 1); i f ( check<0) f l a g = 1; f l a g? p r i n t f ( \n ) : p r i n t f ( \n ); 4 (graph maker.sh) #! bin/sh # l i s t = l s./ mesure ryudai / for dir in $ l i s t ; do f i l e l i s t= $ f i l e l i s t./ mesure ryudai/$dir/h rain. txt done check=./ frequency rain $ f i l e l i s t echo frequency rain. txt > $check # l i n e i n f o = wc l frequency rain. txt

13 for line num in $ l i n e i n f o ; do break done check =./ accumulation rain frequency rain. txt $line num echo accumulation rain. txt > $check # f i l e l i s t= for dir in $ l i s t ; do f i l e l i s t= $ f i l e l i s t./ mesure ryudai/$dir/ten csv. log f i l e l i s t= $ f i l e l i s t./ mesure ryudai/$dir/ten csv. log done check=./frequency demupa $ f i l e l i s t echo frequency demupa 18GHz, 26GHz. txt > $check # l i n e i n f o = wc l frequency demupa 18GHz. txt for line num in $ l i n e i n f o ; do break done check =./ accumulation demupa frequency demupa 18GHz. txt $line num echo accumulation demupa 18GHz. txt l i n e i n f o = wc l frequency demupa 26GHz. txt for line num in $ l i n e i n f o ; do break done > $check check =./ accumulation demupa frequency demupa 26GHz. txt $line num echo accumulation demupa 26GHz. txt > $check graph maker.sh % sh graph_maker.sh frequency_rain.txt > accumulation_rain.txt > frequency_demupa_18ghz, 26GHz.txt ---> accumulation_demupa_18ghz.txt ---> accumulation_demupa_26ghz.txt ---> frequency rain.txt, accumulation rain.txt, frequency demupa 18GHz.txt, frequency demupa 26GHz.txt, accumulation demupa 18GHz.txt, accumulation demupa 26GHz.txt 6 gnuplot

14 10000 frequency-rain.txt e+06 frequency-demupa-18ghz.txt (18GHz)

15 1e+06 frequency-demupa-26ghz.txt (26GHz) 6000 accumulation-rain.txt

16 20 accumulation-demupa-18ghz.txt (18GHz) -10 accumulation-demupa-26ghz.txt (26GHz)

1 ( ) 1.1 (convert.sh) (18GHz 26GHz) C (convert.c, convert1.c) mesure-ryudai convert.sh #!/bin/sh # file1 file1= ls -1 $1 # file1 data for data in $fi

1 ( ) 1.1 (convert.sh) (18GHz 26GHz) C (convert.c, convert1.c) mesure-ryudai convert.sh #!/bin/sh # file1 file1= ls -1 $1 # file1 data for data in $fi I 065712D : 4 1 ( ) 1.1 (convert.sh) (18GHz 26GHz) C (convert.c, convert1.c) mesure-ryudai convert.sh #!/bin/sh # file1 file1= ls -1 $1 # file1 data for data in $file1 do mkdir $data echo " $data " # file2

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

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

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

超初心者用

超初心者用 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

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

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

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

: 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

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

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

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

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

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

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

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

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

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

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

(18,26) 10/ GHz.xls [ (18GHz) ] GHz.xls [ (26GHz) ] +----all.sh [ 2 10 ] +----mesure-ryudai/ / _csv.log [

(18,26) 10/ GHz.xls [ (18GHz) ] GHz.xls [ (26GHz) ] +----all.sh [ 2 10 ] +----mesure-ryudai/ / _csv.log [ I 065762A 19.08.19 19.08.24 19.08.20 1 (18,26) 10/ +----18GHz.xls [ (18GHz) ] +----26GHz.xls [ (26GHz) ] +----all.sh [ 2 10 ] +----mesure-ryudai/ +----20070401/ +----192.168.100.9_csv.log [ (18GHz) ] +----192.168.100.11_csv.log

More information

untitled

untitled C -1 - -2 - concept lecture keywords FILE, fopen, fclose, fscanf, fprintf, EOF, r w a, typedef gifts.dat Yt JZK-3 Jizake tsumeawase 45 BSP-15 Body soap set 3 BT-2 Bath towel set 25 TEA-2 Koutya

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

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

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1 I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara yasu@jaist.ac.jp / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

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

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

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

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

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

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

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

Microsoft PowerPoint - CproNt11.ppt [互換モード] 第 11 章入出力関数とライブラリ関数 CPro:11-01 概要 getchar putchar gets puts scanf printf strcat strcmp strcpy strlen atoi atof sprint sscanf 11.1 コンソール入出力関数 11-02 入力 出力 getchar putchar 一文字 gets puts 文字列 ( 一行 ) scanf printf

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

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

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

Prog1_14th

Prog1_14th 2012 年 7 月 19 日 ( 木 ) 実 施 構 造 体 レコードと 構 造 体 前 々 回 の 教 材 で 触 れたように, 複 数 の 項 目 に 渡 るデータを 一 まとめにしたものをレコードとい う 例 えば, 次 のように 学 籍 番 号, 氏 名, 履 修 科 目 コード, 点 数, 評 価 といった 項 目 による 1 人 分 のデータを 一 まとめにしたものは 1 件 分 のレコードである

More information

P03.ppt

P03.ppt (2) Switch case 5 1 1 2 1 list0317.c if /*/ intnum; printf(""); scanf("%d", &num); 2 if (num % 3 == 0) puts( 0"); else if (num % 3 == 1) puts(" 1"); else puts( 32"); 3 if list0318.c /*/ intnum; printf("");

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

1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1....................................

1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1.................................... 06H082 1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1..................................... 4 3.2 GP.....................................

More information

P05.ppt

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

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

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

C B

C B C 095707B 2010 6 8 1 LEVE1 2 1.1 LEVEL 1.1................................................ 2 1.1.1 1................................................ 2 1.1.2 1.2..............................................

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

2004 2005 2 2 1G01P038-0 1 2 1.1.............................. 2 1.2......................... 2 1.3......................... 3 2 4 2.1............................ 4 2.2....................... 4 2.3.......................

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

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

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

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

(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

問 2 ( 型変換 ) 次のプログラムを実行しても正しい結果が得られない 何が間違いかを指摘し 正しく修正せよ ただし int サイズが 2 バイト long サイズが 4 バイトの処理系での演算を仮定する #include <stdio.h> int main( void ) { int a =

問 2 ( 型変換 ) 次のプログラムを実行しても正しい結果が得られない 何が間違いかを指摘し 正しく修正せよ ただし int サイズが 2 バイト long サイズが 4 バイトの処理系での演算を仮定する #include <stdio.h> int main( void ) { int a = 問 1 配列の宣言整数型配列 data1 にデータが初期設定されている この配列 data1 のデータを下図のように 整数型配列 data2 に代入しなさい また data2 の内容を printf( "data2[0] = %d\n", data2[0] ); printf( "data2[5] = %d\n", data2[5] ); を用いて出力しなさい 実行結果 data2[0] = 76

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

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

Swift1.key

Swift1.key Swift Swift 対象読者としては すでにC 言語および Objective-C( あるいは少なくともJava など ) によるプログラミングの経験がある人を想定しています すでに出版されている入門書や雑誌記事ではSwiftの全体像が把握できないと感じている人には特にお勧めです ジェネリクスの機能や標準ライブラリに関する解説なども含んでおり 現時点では最も 濃い Swift 本になっていると思います

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

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

卒 業 研 究 報 告.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

Prog1_15th

Prog1_15th 2012 年 7 月 26 日 ( 木 ) 実施構造体と typedef typedef 宣言によって,struct 構造体タグ名という表記を再定義し, データ型名のように扱うことができる 構文は typedef struct 構造体タグ名 再定義名 ; となり, この場合の構造体変数の宣言は, 再定義名を用いて行うことができる なお, ここでは 構造体タグ名は省略可能である 構造体を指すポインタ

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

Microsoft PowerPoint - guidance.ppt

Microsoft PowerPoint - guidance.ppt 例題 1. プログラム実行の体験 Microsoft Visual C++ を使ってみよう コンピュータを役に立つ道具として実 感するために, 次ページのプログラムを使って, Microsoft Visual C++ で のプログラム実行を体験する 例題 1 のプログラムの機能 計算の繰り返し キーボードからのデータ読み込み ファイルへの書き出し #include #include

More information

-2 gnuplot( ) j ( ) gnuplot /shell/myscript 1

-2 gnuplot( ) j ( ) gnuplot /shell/myscript 1 -2 gnuplot( ) j 2006 05 03 2006 05 12 2006 05 09 2 ( ) gnuplot /shell/myscript 1 1 shell script Level 1 myls #!/bin/sh # nowdir= pwd # if [ -f $1 -o -z $1 ] ; then echo "Enter pass" echo "ex) myls.sh./"

More information

C ( ) C ( ) C C C C C 1 Fortran Character*72 name Integer age Real income 3 1 C mandata mandata ( ) name age income mandata ( ) mandat

C ( ) C ( ) C C C C C 1 Fortran Character*72 name Integer age Real income 3 1 C mandata mandata ( ) name age income mandata ( ) mandat C () 14 5 23 C () C C C C C 1 Fortran Character*72 name Integer age Real income 3 1 C 1.1 3 7 mandata mandata () name age income mandata () mandata1 1 #include struct mandata char name[51];

More information

C V C 6 1 6.1.............................. 1 6.......................... 3 6.3..................... 5 6.4 NULL............................. 8 6.5......................... 9 6.6..............................

More information

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

& & a a * * ptr p int a ; int *a ; int a ; int a int *a int a = 123; a 123 :100 a 123 int *ptr = & a; a ptr ptr a 100 a 123 200 *ptr 200 a & & a a * * ptr p --------------------------------------------------------------------------------------------- int a

More information

Taro-ファイル処理(公開版).jtd

Taro-ファイル処理(公開版).jtd ファイル処理 0. 目次 1. はじめに 2. ファイル内容の表示 3. ファイル内容の複写 3. 1 文字単位 3. 2 行単位 4. 書式付き入出力 5. 文字配列への入出力 6. 課題 6. 1 課題 1 ( ファイル圧縮 復元 ) - 1 - 1. はじめに ファイル処理プログラムの形は次のようになる #include main() { FILE *fp1,*fp2; ファイルポインタの宣言

More information

Microsoft PowerPoint - kougi6.ppt

Microsoft PowerPoint - kougi6.ppt C プログラミング演習 第 6 回ファイル処理と配列 1 ファイル処理 2 ファイル読み込み ファイル プログラム ファイルの中身は変わらない 3 ファイル書き出し ファイル プログラム ファイルの中身が変わる ファイルは伸び縮みすることがある 4 例題 1. テキストファイル形式の ファイルからのデータ読み込み 次のような名簿ファイル ( テキストファイル形式 ) を読み込んで,1 列目の氏名と,3

More information

Microsoft PowerPoint - 14Chap17.ppt

Microsoft PowerPoint - 14Chap17.ppt 17.1 do-while 文 p.161 例 17.1.1 p.22 例 5.1.1 第 17 章その他の制御文 17.1 do-while 文 17.2 goto 文とラベル 17.3 break 文による繰返し制御 17.4 continue 文による繰返し制御 /* ex17_1_1.c */ do while (i < 10); 条件を満たさなくても 1 回は実行 i = 10; とすると違いがわかる

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

Microsoft PowerPoint - kougi2.ppt

Microsoft PowerPoint - kougi2.ppt C プログラミング演習 第 2 回 Microsoft Visual Studio.NET を使ってみよう 説明 例題 1. プログラム実行の体験 コンピュータを役に立つ道具として実感する 次ページのプログラムを使って, Microsoft Visual Studio.NETでの C++ ソースファイル編集, ビルド, テスト実行の一連の過程を体験する 例題 1 のプログラムの機能 計算の繰り返し

More information

Excel97関数編

Excel97関数編 Excel97 SUM Microsoft Excel 97... 1... 1... 1... 2... 3... 3... 4... 5... 6... 6... 7 SUM... 8... 11 Microsoft Excel 97 AVERAGE MIN MAX SUM IF 2 RANK TODAY ROUND COUNT INT VLOOKUP 1/15 Excel A B C A B

More information

Microsoft PowerPoint - kougi11.ppt

Microsoft PowerPoint - kougi11.ppt C プログラミング演習 中間まとめ 2 1 ソフトウエア開発の流れ 機能設計 外部仕様 ( プログラムの入力と出力の取り決め ) 構成設計 詳細設計 論理試験 内部データ構造や関数呼び出し方法などに関する取り決めソースプログラムの記述正しい入力データから正しい結果が得られるかテスト関数単位からテストをおこなう 耐性試験 異常な入力データに対して, 異常を検出できるかテスト異常終了することはないかテスト

More information

±é½¬£²¡§£Í£Ð£É½éÊâ

±é½¬£²¡§£Í£Ð£É½éÊâ 2012 8 7 1 / 52 MPI Hello World I ( ) Hello World II ( ) I ( ) II ( ) ( sendrecv) π ( ) MPI fortran C wget http://www.na.scitec.kobe-u.ac.jp/ yaguchi/riken2012/enshu2.zip unzip enshu2.zip 2 / 52 FORTRAN

More information

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

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 >> 1 C++ 1.1 C C++ C++ C C C++ 1.1.1 C printf() scanf() C++ C hello world printf() 1-1 #include printf( "hello world\n" ); C++ 1-2 std::cout

More information

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

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

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

1 CUI CUI CUI 1.1 cout cin 1.1.1 redirect.cpp #i n c l u d e <s t r i n g > 3 using namespace std ; 5 6 i n t main ( void ) 7 { 8 s t r i n g s ; 10 c

1 CUI CUI CUI 1.1 cout cin 1.1.1 redirect.cpp #i n c l u d e <s t r i n g > 3 using namespace std ; 5 6 i n t main ( void ) 7 { 8 s t r i n g s ; 10 c C/C++ 007 6 11 1 CUI 1.1....................................... 1................................ 3 1.3 argc argv................................. 5.1.............................................. 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

+ +

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

More information

main

main 14 1. 12 5 main 1.23 3 1.230000 3 1.860867 1 2. 1988 1925 1911 1867 void JPcalendar(int x) 1987 1 64 1 1 1 while(1) Ctrl C void JPcalendar(int x){ if (x > 1988) printf(" %d %d \n", x, x-1988); else if(x

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

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó 2 2015 4 20 1 (4/13) : ruby 2 / 49 2 ( ) : gnuplot 3 / 49 1 1 2014 6 IIJ / 4 / 49 1 ( ) / 5 / 49 ( ) 6 / 49 (summary statistics) : (mean) (median) (mode) : (range) (variance) (standard deviation) 7 / 49

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

3 3.1 LAN ISDN (IP) 2 TCP/UDP IP IP IP IP (Ethernet) Ethernet LAN TCP/UDP LAN Ethernet LAN 2: Ethernet ATM, FDDI, LAN IP IP IP 3 IP 2 IP IP IP IP IP 3

3 3.1 LAN ISDN (IP) 2 TCP/UDP IP IP IP IP (Ethernet) Ethernet LAN TCP/UDP LAN Ethernet LAN 2: Ethernet ATM, FDDI, LAN IP IP IP 3 IP 2 IP IP IP IP IP 3 IP 1 (IP) TCP/IP 1 2 2 1 LAN IP C IP 192.168.0.101 192.168.0.104 HUB 100Base-TX 100Mbps UTP Ethernet HUB 192.168.0.101 192.168.0.102 192.168.0.103 192.168.0.104 1: 6 1 3 3.1 LAN ISDN (IP) 2 TCP/UDP IP

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

memo

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

More information

Microsoft PowerPoint - kougi4.ppt

Microsoft PowerPoint - kougi4.ppt C の実行モデル 自由落下距離 前回の授業の 例題 1 の復習と重要事項 の確認 地上で物を落とし始めた後の自由落下距離を 求める 重力加速度 g は 9.8 とする 自由落下距離を求めるために, プログラム中に, 計算式 y = ( 9.8 / 2.0 ) * x * x を書く C++ ソースファイルの編集 編集画面 編集中のファイル名 関係するファイルなどが表示される ビルド結果などが表示される画面

More information

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

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル Instruction Manual Disk No. RE01 6th Edition: November 1999 (YK) All Rights Reserved, Copyright 1996 Yokogawa Electric Corporation 801234567 9 ABCDEF 1 2 3 4 1 2 3 4 1 2 3 4 1 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

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

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

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

Microsoft Word - Cプログラミング演習(8) 第 8 回 (6/11) プログラミングスタイルなど [1] 名前のつけかた グローバル変数にはわかりやすい名前を, ローカル変数には短い名前を 関連性のあるものには関連性のある名前をつけて, 統一しよう 関数には能動的な名前を 名前は的確に 例題 1 次のコードの名前と値の選び方についてコメントせよ? #define TRUE 0? #define FALSE 1?? if ((ch = getchar())

More information

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

Microsoft Word - Cプログラミング演習(10) 第 10 回 (6/25) 3. ファイルとその応用 (3) ファイルの更新 シーケンシャルファイルの更新 シーケンシャルファイルでは, 各レコードが可変長で連続して格納されており, その中の特定のレコードを変更することができない そこで一般的には, マスタファイルからデータを取り出し, 更新処理を行ったあとに新マスタファイルに書き込む 注 ) マスタファイル : 主ファイル, 基本ファイルと呼ばれるファイルで内容は比較的固定的であり,

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

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

gengo1-12

gengo1-12 外部変数 関数の外で定義される変数を外部変数 ( 大域変数 ) と呼ぶ 外部変数のスコープは広域的 ( プログラム全体 ) 全ての関数で参照可能 int a=10; double x=3.14159; printf( a = %d\n, a); sample(); printf( %f\n, x); void sample(void) printf( %f\n, x); x += 1.0; 外部変数

More information

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

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 C++ 1 C C++ C++ C C C++ 1.1 C printf() scanf() C++ C 1-1 #include int a; scanf( "%d", &a ); printf( "a = %d\n", a ); C++ 1-2 int a; std::cin >> a; std::cout

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

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