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

Size: px
Start display at page:

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

Transcription

1 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

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

3 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 F 2 G 4 2. "s21-3d.data" : 1 2: 1 3D 3

4 "s21-2dhis.data" : 1 "s22-3d.data" : 3 5: 2 3D 7000 "s22-2dhis.data" : 2 4

5 : p- - 1 ( :13% :108) 8: p- - 2 ( :12% :101),,. 9: p- - 1( :30%) 10: p- - 2( :30%) 11: p- - 1( :50%) 12: p- - 2( :50%) 5

6 13: p- - 1( :80%) 14: p- - 2( :80%) : 1 16: : 1 6

7 "s21-33-statistic.data" u 1:2 "s21-33-statistic.data" u 1: histogram bibun-histogram : 1 ( ) ( ) 19: "s22-33-statistic.data" u 1:2 "s22-33-statistic.data" u 1: histogram bibun-histogram : 2 ( ) ( ) 7

8 "s21-34statistic.data" u 1:2 "s21-34statistic.data" u 1: : : "s22-34statistic.data" u 1:2 "s22-34statistic.data" u 1: : : 2 8

9 : : : : : : - 2 9

10 : /* ################ 2 # 2 - p # 3 ################# */ 4 5 #include<s t d i o. h> 6 #include<s t d l i b. h> 7 #include<time. h> 8 #include<math. h> 9 #define MAX int main ( int argc, char argv [ ] ) 12 { 13 /* */ 14 FILE f i n, fout, f s t a t i s t i c ; 15 char l i n e [MAX] ; 16 int i, j, k, width, height, max ; /*,, */ 17 int f, g ; 18 c l o c k t s t a r t, end ; 19 int per =0; /* */ 20 int gazousuu =0, menseki =0; 21 int histogram, sum=0,tmp=0, s i k i i t i =0; /* #################### FILE OPEN ######################### */ 24 i f ( argc!=3){ 25 p r i n t f ( Argument Error. Try Again \n ) ; return ; 26 } i f ( ( f i n=fopen ( argv [ 1 ], r ))==NULL){ /* INPUT FILE */ 29 f p r i n t f ( s t d e r r, %s : cannot f i n d %s \n, argv [ 0 ], argv [ 1 ] ) ; 30 return ; 31 } i f ( ( f o u t=fopen ( argv [ 2 ], w ))==NULL){ /* OUTPUT FILE */ 34 f p r i n t f ( s t d e r r, %s : cannot open %s \n, argv [ 0 ], argv [ 2 ] ) ; 35 return ; 36 } 37 /* */ 38 i f ( ( f s t a t i s t i c=fopen ( p t a i l s t a t i s t i c. data, a ) ) ==NULL){ 39 f p r i n t f ( s t d e r r, Cannot open s t a t i s t i c f i l e \n ) ; 40 return ; 41 } /* #################### FILE HEADER ####################### */ 44 i =0; j =0; 45 while ( 1 ) { 46 f g e t s ( l i n e,max, f i n ) ; j ++; 47 i f ( l i n e [ 0 ]! = # ){ /* */ 48 f p r i n t f ( stdout, %s, l i n e ) ; 49 i ++; 50 i f ( i ==2){ /*2 = */ 51 s s c a n f ( l i n e, %d %d,&width,& h e i g h t ) ; /* */ 52 } 53 i f ( i ==3){ /*3 = */ 54 s s c a n f ( l i n e, %d,&max ) ; /* */ 10

11 55 } 56 i f ( i!=3) 57 f p r i n t f ( fout, %s, l i n e ) ; /* */ 58 else { 59 f p r i n t f ( fout, 1\n ) ; 60 break ; /*3 w h i l e */ 61 } 62 } 63 else { /* */ 64 i f ( j ==10) break ; /* */ 65 else continue ; 66 } 67 } /* ################### PREPARE MEMORY ##################### */ 70 f =(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 71 g=(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 72 i f ( f==null g==null){ 73 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 74 } 75 for ( i =0; i <h e i g h t ; i ++){ 76 f [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 77 g [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 78 i f ( f [ i ]==NULL g [ i ]==NULL){ 79 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 80 } 81 } histogram=(int ) malloc ( s i z e o f ( int ) max ) ; 84 i f ( histogram==null){ 85 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 86 } 87 for ( i =0; i <(max+1); i ++){ /* */ 88 histogram [ i ]=0; 89 } 90 /* #################### READ DATA ######################## */ 91 for ( i =0; i <h e i g h t ; i ++){ 92 for ( j =0; j<width ; j ++){ 93 f s c a n f ( f i n, %d,& f [ i ] [ j ] ) ; 94 g [ i ] [ j ]= f [ i ] [ j ] ; /* g[i][j] */ 95 } 96 } /* ################## MAIN PROCESING #################### */ 99 p r i n t f ( p \n ) ; 100 /* */ 101 p r i n t f ( : ) ; 102 s c a n f ( %d,& per ) ; 103 s t a r t=c l o c k ( ) ; f p r i n t f ( f s t a t i s t i c, %s,%d,, argv [ 1 ], per ) ; /* */ 108 for ( i =0; i <h e i g h t ; i ++){ 109 for ( j =0; j<width ; j ++){ 110 histogram [ f [ i ] [ j ]]++; 111 } 112 } 11

12 gazousuu=h e i g h t width ; 115 p r i n t f ( : %d\n, gazousuu ) ; f p r i n t f ( f s t a t i s t i c, %d,, gazousuu ) ; gazousuu=(int ) ( gazousuu per ) ; /* */ 120 p r i n t f ( : %d\n, gazousuu ) ; f p r i n t f ( f s t a t i s t i c, %d,, gazousuu ) ; i =0; menseki =0; 125 while ( menseki < gazousuu && i <(max+1)){ 126 /* */ 127 menseki +=histogram [ i ] ; 128 i ++; 129 } 130 s i k i i t i =i 1; p r i n t f ( : %d\n, s i k i i t i ) ; 133 f p r i n t f ( f s t a t i s t i c, %d,, s i k i i t i ) ; for ( i =0; i <h e i g h t ; i ++){ 136 for ( j =0; j<width ; j ++){ 137 i f ( g [ i ] [ j ]< s i k i i t i ) 138 g [ i ] [ j ]=0; 139 else 140 g [ i ] [ j ]=1; 141 } 142 } end=c l o c k ( ) ; 145 p r i n t f ( TIME: %.6 l f s e c \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; f p r i n t f ( f s t a t i s t i c, %.4 l f \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 148 /* #################### WRITE DATA # #################### */ 149 k=0; 150 for ( i =0; i <h e i g h t ; i ++){ 151 for ( j =0; j<width ; j ++){ 152 k++; 153 f p r i n t f ( fout, %3d, g [ i ] [ j ] ) ; /* */ 154 i f ( k==17){ 155 f p r i n t f ( fout, \n ) ; 156 k=0; 157 } 158 } 159 } 160 /* ################### CLOSE FILE ####################### */ 161 f c l o s e ( f o u t ) ; 162 f c l o s e ( f i n ) ; 163 f c l o s e ( f s t a t i s t i c ) ; 164 return 0 ; 165 }

13 2: /* ################ 2 # 2 - # 3 ################# */ 4 5 #include<s t d i o. h> 6 #include<time. h> 7 #include<s t d l i b. h> 8 #include<math. h> 9 #define MAX #define SPACE 5 11 int main ( int argc, char argv [ ] ) 12 { 13 /* */ 14 FILE f i n, fout, f s t a t i s t i c ; 15 char l i n e [MAX] ; 16 int i, j, k, width, height, max ; /*,, */ 17 int f, g ; 18 c l o c k t s t a r t, end ; 19 int histogram, yamamax=0, s i k i i t i =0; 20 int tmp=0,tmp1=0, maxleft =0, maxright =0,min=0; 21 /* #################### FILE OPEN ######################### */ 22 i f ( argc!=3){ 23 p r i n t f ( Argument Error. Try Again \n ) ; return ; 24 } i f ( ( f i n=fopen ( argv [ 1 ], r ))==NULL){ /* INPUT FILE */ 27 f p r i n t f ( s t d e r r, %s : cannot f i n d %s \n, argv [ 0 ], argv [ 1 ] ) ; 28 return ; 29 } i f ( ( f o u t=fopen ( argv [ 2 ], w ))==NULL){ /* OUTPUT FILE */ 32 f p r i n t f ( s t d e r r, %s : cannot open %s \n, argv [ 0 ], argv [ 2 ] ) ; 33 return ; 34 } 35 /* */ 36 i f ( ( f s t a t i s t i c=fopen ( m o d e m e t h o d s t a t i s t i c. data, a ))==NULL ){ 37 f p r i n t f ( s t d e r r, Cannot open s t a t i s t i c f i l e \n ) ; 38 return ; 39 } 40 /* #################### FILE HEADER ####################### */ 41 i =0; j =0; 42 while ( 1 ) { 43 f g e t s ( l i n e,max, f i n ) ; j ++; 44 i f ( l i n e [ 0 ]! = # ){ /* */ 45 f p r i n t f ( stdout, %s, l i n e ) ; 46 i ++; 47 i f ( i ==2){ /*2 = */ 48 s s c a n f ( l i n e, %d %d,&width,& h e i g h t ) ; /* */ 49 } 50 i f ( i ==3){ /*3 = */ 51 s s c a n f ( l i n e, %d,&max ) ; /* */ 52 } 53 i f ( i!=3) 54 f p r i n t f ( fout, %s, l i n e ) ; /* */ 55 else { 56 f p r i n t f ( fout, 1\n ) ; 57 break ; /*3 w h i l e */ 13

14 58 } 59 } 60 else { /* */ 61 i f ( j ==10) break ; /* */ 62 else continue ; 63 } 64 } /* ################### PREPARE MEMORY ##################### */ 67 f =(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 68 g=(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 69 i f ( f==null g==null){ 70 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 71 } 72 for ( i =0; i <h e i g h t ; i ++){ 73 f [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 74 g [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 75 i f ( f [ i ]==NULL g [ i ]==NULL){ 76 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 77 } 78 } histogram=(int ) malloc ( s i z e o f ( int ) (max+1)); 81 i f ( histogram==null){ 82 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 83 } 84 for ( i =0; i <(max+1); i ++){ /* */ 85 histogram [ i ]=0; 86 } 87 /* #################### READ DATA ######################## */ 88 for ( i =0; i <h e i g h t ; i ++){ 89 for ( j =0; j<width ; j ++){ 90 f s c a n f ( f i n, %d,& f [ i ] [ j ] ) ; 91 g [ i ] [ j ]= f [ i ] [ j ] ; 92 } 93 } /* ################## MAIN PROCESING #################### */ 96 p r i n t f ( \n ) ; 97 s t a r t=c l o c k ( ) ; 98 f p r i n t f ( f s t a t i s t i c, %s,, argv [ 1 ] ) ; 99 for ( i =0; i <h e i g h t ; i ++){ /* */ 100 for ( j =0; j<width ; j ++){ 101 histogram [ f [ i ] [ j ]]++; 102 } 103 } 104 /* ( ) */ 105 yamamax=0; j =0; 106 for ( i =0; i <(max+1); i ++){ 107 i f ( j<histogram [ i ] ) { 108 j=histogram [ i ] ; 109 yamamax=i ; 110 } 111 } 112 f p r i n t f ( f s t a t i s t i c, %d,,yamamax ) ; /* */ 115 /* */ 14

15 116 tmp=1; 117 for ( i=yamamax ; i >1; i ){ 118 i f ( histogram [ i ]< histogram [ i 1] && 119 f a b s ( histogram [ i ] histogram [ i 1])>SPACE){ 120 tmp=i ; 121 break ; 122 } 123 } 124 f p r i n t f ( f s t a t i s t i c, %d,,tmp ) ; 125 /*0 */ 126 maxleft =0; j =0; 127 for ( i =0; i <tmp ; i ++){ 128 i f ( histogram [ i ]>= j ){ 129 j=histogram [ i ] ; 130 maxleft=i ; 131 } 132 } 133 f p r i n t f ( f s t a t i s t i c, %d,, maxleft ) ; 134 /* */ 135 tmp1=max ; 136 for ( i=yamamax ; i <(max+1); i ++){ 137 i f ( histogram [ i ]< histogram [ i +1] && 138 f a b s ( histogram [ i ] histogram [ i +1])>SPACE){ 139 tmp1=i ; 140 break ; 141 } 142 } 143 f p r i n t f ( f s t a t i s t i c, %d,, tmp1 ) ; 144 /* t m p 1 */ 145 maxright=max ; j =0; 146 for ( i=tmp1+1; i <max+1; i ++){ 147 i f ( histogram [ i ]>= j ){ 148 j=histogram [ i ] ; 149 maxright=i ; 150 } 151 } 152 f p r i n t f ( f s t a t i s t i c, maxrihgt:%d,, maxright ) ; i f ( histogram [ maxleft ]> histogram [ maxright ] ) { 155 f p r i n t f ( f s t a t i s t i c, Saiyou :%d,, maxleft ) ; 156 s i k i i t i =(int ) ( ( yamamax+maxleft ) / 2 ) ; 157 } 158 else i f ( histogram [ maxleft ]< histogram [ maxright ] ) { 159 f p r i n t f ( f s t a t i s t i c, Saiyou%d,, maxright ) ; 160 s i k i i t i =(int ) ( ( yamamax+maxright ) / 2 ) ; 161 } 162 else { 163 i f ( ( yamamax maxleft )>=(maxright yamamax ) ) { 164 f p r i n t f ( f s t a t i s t i c, Saiyou : %d,, maxleft ) ; 165 s i k i i t i =(int ) ( ( yamamax+maxleft ) / 2 ) ; 166 } else { 167 f p r i n t f ( f s t a t i s t i c, Saiyou : %d,, maxright ) ; 168 s i k i i t i =(int ) ( ( yamamax+maxright ) / 2 ) ; 169 } 170 } f p r i n t f ( f s t a t i s t i c, s i k i t i :%d,, s i k i i t i ) ;

16 174 for ( i =0; i <h e i g h t ; i ++){ 175 for ( j =0; j<width ; j ++){ 176 i f ( g [ i ] [ j ]<= s i k i i t i ) 177 g [ i ] [ j ]=0; 178 else 179 g [ i ] [ j ]=1; 180 } 181 } end=c l o c k ( ) ; 184 p r i n t f ( TIME: %.6 l f s e c \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 185 f p r i n t f ( f s t a t i s t i c, %.4 l f \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 186 /* #################### WRITE DATA # #################### */ 187 k=0; 188 for ( i =0; i <h e i g h t ; i ++){ 189 for ( j =0; j<width ; j ++){ 190 k++; 191 f p r i n t f ( fout, %3d, g [ i ] [ j ] ) ; /* */ 192 i f ( k==17){ 193 f p r i n t f ( fout, \n ) ; 194 k=0; 195 } 196 } 197 } 198 /* ################### CLOSE FILE ####################### */ 199 f c l o s e ( f o u t ) ; 200 f c l o s e ( f i n ) ; 201 f c l o s e ( f s t a t i s t i c ) ; 202 return ; 203 } : /* ################ 2 # 2 - # 3 ################# */ 4 5 #include<s t d i o. h> 6 #include<s t d l i b. h> 7 #include<time. h> 8 #include<math. h> 9 #define MAX int main ( int argc, char argv [ ] ) 12 { 13 /* */ 14 FILE f i n, fout, f s t a t i s t i c ; 15 char l i n e [MAX] ; 16 int i, j, k, width, height, max ; /*,, */ 17 int f, g ; 18 c l o c k t s t a r t, end ; 19 int bibun [ 8 ], histogram, sum=0,tmp=0, s i k i i t i =0; /* */ 20 int h i s ; /* */ 21 /* #################### FILE OPEN ######################### */ 16

17 22 i f ( argc!=3){ 23 p r i n t f ( Argument Error. Try Again \n ) ; return ; 24 } 25 i f ( ( f i n=fopen ( argv [ 1 ], r ))==NULL){ /* INPUT FILE */ 26 f p r i n t f ( s t d e r r, %s : cannot f i n d %s \n, argv [ 0 ], argv [ 1 ] ) ; 27 return ; 28 } 29 i f ( ( f o u t=fopen ( argv [ 2 ], w ))==NULL){ /* OUTPUT FILE */ 30 f p r i n t f ( s t d e r r, %s : cannot open %s \n, argv [ 0 ], argv [ 2 ] ) ; 31 return ; 32 } 33 i f ( ( f s t a t i s t i c=fopen ( b i b u n s t a t i s t i c. data, a ))==NULL){ 34 f p r i n t f ( s t d e r r, Cannot open s t a t i s t i c f i l e \n ) ; 35 return ; 36 } 37 /* #################### FILE HEADER ####################### */ 38 i =0; j =0; 39 while ( 1 ) { 40 f g e t s ( l i n e,max, f i n ) ; j ++; 41 i f ( l i n e [ 0 ]! = # ){ /* */ 42 f p r i n t f ( stdout, %s, l i n e ) ; 43 i ++; 44 i f ( i ==2){ /*2 = */ 45 s s c a n f ( l i n e, %d %d,&width,& h e i g h t ) ; /* */ 46 } 47 i f ( i ==3){ /*3 = */ 48 s s c a n f ( l i n e, %d,&max ) ; /* */ 49 } 50 i f ( i!=3) 51 f p r i n t f ( fout, %s, l i n e ) ; /* */ 52 else { 53 f p r i n t f ( fout, 1\n ) ; 54 break ; /*3 w h i l e */ 55 } 56 } 57 else { /* */ 58 i f ( j ==10) break ; /* */ 59 else continue ; 60 } 61 } /* ################### PREPARE MEMORY ##################### */ 64 f =(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 65 g=(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 66 i f ( f==null g==null){ 67 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 68 } 69 for ( i =0; i <h e i g h t ; i ++){ 70 f [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 71 g [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 72 i f ( f [ i ]==NULL g [ i ]==NULL){ 73 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 74 } 75 } histogram=(int ) malloc ( s i z e o f ( int ) (max+1)); 78 h i s =(int ) malloc ( s i z e o f ( int ) (max+1)); 79 i f ( histogram==null h i s==null){ 17

18 80 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 81 } 82 for ( i =0; i <(max+1); i ++){ 83 histogram [ i ]=0; h i s [ i ]=0; 84 } 85 /* #################### READ DATA ######################## */ 86 for ( i =0; i <h e i g h t ; i ++){ 87 for ( j =0; j<width ; j ++){ 88 f s c a n f ( f i n, %d,& f [ i ] [ j ] ) ; 89 g [ i ] [ j ]= f [ i ] [ j ] ; 90 } 91 } /* ################## MAIN PROCESING #################### */ 94 f p r i n t f ( f s t a t i s t i c, #%s \n, argv [ 1 ] ) ; 95 p r i n t f ( \n ) ; 96 s t a r t=c l o c k ( ) ; 97 /* 8 */ 98 for ( i =0; i <h e i g h t ; i ++){ 99 for ( j =0; j<width ; j ++){ 100 h i s [ f [ i ] [ j ]]++; 101 } 102 } for ( i =1; i <height 1; i ++){ 105 for ( j =1; j<width 1; j ++){ 106 bibun [0]= f a b s ( f [ i ] [ j ] f [ i 1][ j 1 ] ) ; 107 bibun [1]= f a b s ( f [ i ] [ j ] f [ i 1][ j ] ) ; 108 bibun [2]= f a b s ( f [ i ] [ j ] f [ i 1][ j + 1 ] ) ; 109 bibun [3]= f a b s ( f [ i ] [ j ] f [ i ] [ j 1 ] ) ; 110 bibun [4]= f a b s ( f [ i ] [ j ] f [ i ] [ j + 1 ] ) ; 111 bibun [5]= f a b s ( f [ i ] [ j ] f [ i +1][ j 1 ] ) ; 112 bibun [6]= f a b s ( f [ i ] [ j ] f [ i +1][ j ] ) ; 113 bibun [7]= f a b s ( f [ i ] [ j ] f [ i +1][ j + 1 ] ) ; 114 for ( k=0;k<8;k++){ 115 sum+=bibun [ k ] ; 116 } 117 histogram [ f [ i ] [ j ]]+=sum ; /* */ 118 sum=0; 119 } 120 } for ( i =0; i <(max+1); i ++){ 123 f p r i n t f ( f s t a t i s t i c, %5d %7d %7d\n, i, h i s [ i ], histogram [ i ] ) ; 124 } tmp=0; 127 for ( i =0; i <(max+1); i ++){ 128 i f (tmp<histogram [ i ] ) { 129 tmp=histogram [ i ] ; /* */ 130 s i k i i t i =i ; /* */ 131 } 132 } 133 p r i n t f ( :%5d\n, s i k i i t i ) ; /* */ 134 f p r i n t f ( f s t a t i s t i c, #%d\n, s i k i i t i ) ; for ( i =1; i <height 1; i ++){ 137 for ( j =1; j<width ; j ++){ 18

19 138 i f ( g [ i ] [ j ]<= s i k i i t i ) 139 g [ i ] [ j ]=0; 140 else 141 g [ i ] [ j ]=1; 142 } 143 } 144 /* */ 145 for ( i =0; i <width ; i ++){ 146 i f ( g [ 0 ] [ i ]<= s i k i i t i ) 147 g [ 0 ] [ i ]=0; 148 else 149 g [ 0 ] [ i ]=1; i f ( g [ height 1][ i ]<= s i k i i t i ) 152 g [ height 1][ i ]=0; 153 else 154 g [ height 1][ i ]=1; 155 } 156 for ( i =0; i <h e i g h t ; i ++){ 157 i f ( g [ i ][0] <= s i k i i t i ) 158 g [ i ] [ 0 ] = 0 ; 159 else 160 g [ i ] [ 0 ] = 1 ; i f ( g [ i ] [ width 1]<= s i k i i t i ) 163 g [ i ] [ width 1]=0; 164 else 165 g [ i ] [ width 1]=1; 166 } end=c l o c k ( ) ; 169 p r i n t f ( TIME: %.6 l f s e c \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 170 f p r i n t f ( f s t a t i s t i c, #time :%.6 l f \n\n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 171 /* #################### WRITE DATA # #################### */ 172 k=0; 173 for ( i =0; i <h e i g h t ; i ++){ 174 for ( j =0; j<width ; j ++){ 175 k++; 176 f p r i n t f ( fout, %3d, g [ i ] [ j ] ) ; /* */ 177 i f ( k==17){ 178 f p r i n t f ( fout, \n ) ; 179 k=0; 180 } 181 } 182 } 183 /* ################### CLOSE FILE ####################### */ 184 f c l o s e ( f o u t ) ; 185 f c l o s e ( f i n ) ; 186 f c l o s e ( f s t a t i s t i c ) ; 187 return ; 188 } :

20 1 /* ################ 2 # 2 - # 3 ################# */ 4 5 #include<s t d i o. h> 6 #include<s t d l i b. h> 7 #include<time. h> 8 #include<math. h> 9 #define MAX int main ( int argc, char argv [ ] ) 12 { 13 /* r */ 14 FILE f i n, fout, f s t a t i s t i c ; 15 char l i n e [MAX] ; 16 int i, j, k, width, height, max ; /*,, */ 17 int f, g ; 18 c l o c k t s t a r t, end ; 19 int histogram, s i k i i t i =0; 20 int c l a s s l n u m =0, class rnum =0; 21 int c l a s s l a v e =0, c l a s s r a v e =0; 22 int c l a s s l b u n =0, c l a s s r b u n =0; 23 double tmp1=0,tmp2=0; 24 double bun max =0.; 25 /* #################### FILE OPEN ######################### */ 26 i f ( argc!=3){ 27 p r i n t f ( Argument Error. Try Again \n ) ; return ; 28 } i f ( ( f i n=fopen ( argv [ 1 ], r ))==NULL){ /* INPUT FILE */ 31 f p r i n t f ( s t d e r r, %s : Cannot f i n d \n, argv [ 1 ] ) ; 32 return ; 33 } i f ( ( f o u t=fopen ( argv [ 2 ], w ))==NULL){ /* OUTPUT FILE */ 36 f p r i n t f ( s t d e r r, %s : Cannot open \n, argv [ 2 ] ) ; 37 return ; 38 } 39 i f ( ( f s t a t i s t i c=fopen ( h b m e t h o d s t a t i s t i c. data, a ))==NULL){ 40 f p r i n t f ( s t d e r r, Cannot open s t a t i s t i c f i l e \n ) ; 41 return ; 42 } 43 /* #################### FILE HEADER ####################### */ 44 i =0; j =0; 45 while ( 1 ) { 46 f g e t s ( l i n e,max, f i n ) ; j ++; 47 i f ( l i n e [ 0 ]! = # ){ /* */ 48 f p r i n t f ( stdout, %s, l i n e ) ; 49 i ++; 50 i f ( i ==2){ /*2 = */ 51 s s c a n f ( l i n e, %d %d,&width,& h e i g h t ) ; /* */ 52 } 53 i f ( i ==3){ /*3 = */ 54 s s c a n f ( l i n e, %d,&max ) ; /* */ 55 } 56 i f ( i!=3) 57 f p r i n t f ( fout, %s, l i n e ) ; /* */ 58 else { 20

21 59 f p r i n t f ( fout, 1\n ) ; 60 break ; /*3 w h i l e */ 61 } 62 } 63 else { /* */ 64 i f ( j ==10) break ; /* */ 65 else continue ; 66 } 67 } /* ################### PREPARE MEMORY ##################### */ 70 f =(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 71 g=(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 72 i f ( f==null g==null){ 73 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 74 } 75 for ( i =0; i <h e i g h t ; i ++){ 76 f [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 77 g [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 78 i f ( f [ i ]==NULL g [ i ]==NULL){ 79 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 80 } 81 } histogram=(int ) malloc ( s i z e o f ( int ) (max+1)); 84 i f ( histogram==null){ 85 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 86 } 87 for ( i =0; i <max ; i ++){ /* */ 88 histogram [ i ]=0; 89 } 90 /* #################### READ DATA ######################## */ 91 for ( i =0; i <h e i g h t ; i ++){ 92 for ( j =0; j<width ; j ++){ 93 f s c a n f ( f i n, %d,& f [ i ] [ j ] ) ; 94 g [ i ] [ j ]= f [ i ] [ j ] ; 95 } 96 } /* ################## MAIN PROCESING #################### */ 99 p r i n t f ( \n ) ; 100 s t a r t=c l o c k ( ) ; 101 for ( i =0; i <h e i g h t ; i ++){ /* */ 102 for ( j =0; j<width ; j ++){ 103 histogram [ f [ i ] [ j ]]++; 104 } 105 } 106 f p r i n t f ( f s t a t i s t i c, #%s \n, argv [ 1 ] ) ; 107 /*2 */ 108 for ( i =0; i <(max+1); i ++){ 109 c l a s s l n u m=class rnum =0; 110 c l a s s l a v e=c l a s s r a v e =0; for ( j =0; j<i ; j ++){ 113 c l a s s l n u m+=histogram [ j ] ; 114 } class rnum=( h e i g h t width) c l a s s l n u m ; 21

22 i f ( c l a s s l n u m==0) c l a s s l n u m =1; 119 i f ( class rnum==0) class rnum =1; /* */ 123 for ( j =0; j<i ; j ++){ 124 c l a s s l a v e+=histogram [ j ] j ; 125 } 126 c l a s s l a v e=c l a s s l a v e / c l a s s l n u m ; for ( j=i ; j <(max+1); j ++){ 129 c l a s s r a v e+=histogram [ j ] j ; 130 } 131 c l a s s r a v e=c l a s s r a v e / class rnum ; tmp1=1. c l a s s l n u m class rnum pow ( ( c l a s s l a v e c l a s s r a v e ), 2 ) ; 135 tmp2=1. pow ( ( c l a s s l n u m+class rnum ), 2 ) ; f p r i n t f ( f s t a t i s t i c, %5d %7d %15.5 l f \n, i, histogram [ i ], tmp1/tmp2 ) ; i f ( bun max<(tmp1/tmp2 ) ) { 140 bun max=(tmp1/tmp2 ) ; 141 s i k i i t i =i ; 142 } 143 } p r i n t f ( %d\n, s i k i i t i ) ; 146 f p r i n t f ( f s t a t i s t i c, #%d\n, s i k i i t i ) ; for ( i =0; i <h e i g h t ; i ++){ 149 for ( j =0; j<width ; j ++){ 150 i f ( f [ i ] [ j ]>= s i k i i t i ) 151 g [ i ] [ j ]=1; 152 else 153 g [ i ] [ j ]=0; 154 } 155 } end=c l o c k ( ) ; 158 p r i n t f ( TIME: %.6 l f s e c \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 159 f p r i n t f ( f s t a t i s t i c, #%.5 l f \n\n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 160 /* #################### WRITE DATA # #################### */ 161 k=0; 162 for ( i =0; i <h e i g h t ; i ++){ 163 for ( j =0; j<width ; j ++){ 164 k++; 165 f p r i n t f ( fout, %3d, g [ i ] [ j ] ) ; /* */ 166 i f ( k==17){ 167 f p r i n t f ( fout, \n ) ; 168 k=0; 169 } 170 } 171 } 172 /* ################### CLOSE FILE ####################### */ 173 f c l o s e ( f o u t ) ; 174 f c l o s e ( f i n ) ; 22

23 175 f c l o s e ( f s t a t i s t i c ) ; 176 return ; 177 } : /* ################ 2 # 2 - # 3 ################# */ 4 5 #include<s t d i o. h> 6 #include<s t d l i b. h> 7 #include<math. h> 8 #include<time. h> 9 10 #define MAX void hb method ( int x1, int y1, int x2, int y2 ) ; FILE f i n, fout, f s t a t i s t i c ; /* */ 14 int max, width, h e i g h t ; /*,, */ 15 int f, g ; 16 int histogram ; 17 int s i k i i t i =0; 18 int main ( int argc, char argv [ ] ) 19 { char l i n e [MAX] ; 22 int i, j, k ; 23 c l o c k t s t a r t, end ; 24 int yoko jump =0, tate jump =0; 25 int x1, y1, x2, y2, tate, yoko, amari y, amari t ; 26 /* #################### FILE OPEN ######################### */ 27 i f ( argc!=3){ 28 p r i n t f ( Argument Error. Try Again \n ) ; return ; 29 } i f ( ( f i n=fopen ( argv [ 1 ], r ))==NULL){ /* INPUT FILE */ 32 f p r i n t f ( s t d e r r, %s : cannot f i n d %s \n, argv [ 0 ], argv [ 1 ] ) ; 33 return ; 34 } i f ( ( f o u t=fopen ( argv [ 2 ], w ))==NULL){ /* OUTPUT FILE */ 37 f p r i n t f ( s t d e r r, %s : cannot open %s \n, argv [ 0 ], argv [ 2 ] ) ; 38 return ; 39 } 40 i f ( ( f s t a t i s t i c=fopen ( 3 5 s t a t i s t i c. data, a ))==NULL ){ 41 f p r i n t f ( s t d e r r, Cannot open s t a t i s t i c f i l e \n ) ; 42 return ; 43 } 44 /* #################### FILE HEADER ####################### */ 45 i =0; j =0; 46 while ( 1 ) { 47 f g e t s ( l i n e,max, f i n ) ; j ++; 48 i f ( l i n e [ 0 ]! = # ){ /* */ 23

24 49 f p r i n t f ( stdout, %s, l i n e ) ; 50 i ++; 51 i f ( i ==2){ /*2 = */ 52 s s c a n f ( l i n e, %d %d,&width,& h e i g h t ) ; /* */ 53 } 54 i f ( i ==3){ /*3 = */ 55 s s c a n f ( l i n e, %d,&max ) ; /* */ 56 } 57 i f ( i!=3) 58 f p r i n t f ( fout, %s, l i n e ) ; /* */ 59 else { 60 f p r i n t f ( fout, 1\n ) ; 61 break ; /*3 w h i l e */ 62 } 63 } 64 else { /* */ 65 i f ( j ==10) break ; /* */ 66 else continue ; 67 } 68 } 69 /* ################### PREPARE MEMORY ##################### */ 70 /* */ 71 f =(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 72 g=(int ) malloc ( s i z e o f ( int ) h e i g h t ) ; 73 i f ( f==null g==null){ 74 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 75 } 76 for ( i =0; i <h e i g h t ; i ++){ 77 f [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 78 g [ i ]=( int ) malloc ( s i z e o f ( int ) width ) ; 79 i f ( f [ i ]==NULL g [ i ]==NULL){ 80 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 81 } 82 } 83 /* */ 84 histogram=(int ) malloc ( s i z e o f ( int ) (max+1)); 85 i f ( histogram==null){ 86 p r i n t f ( Memory Error. Try Again. \ n ) ; return ; 87 } 88 for ( i =0; i <(max+1); i ++){ 89 histogram [ i ]=0; 90 } /* #################### READ DATA ######################## */ 93 for ( i =0; i <h e i g h t ; i ++){ 94 for ( j =0; j<width ; j ++){ 95 f s c a n f ( f i n, %d,& f [ i ] [ j ] ) ; 96 g [ i ] [ j ]= f [ i ] [ j ] ; 97 } 98 } /* ################## MAIN PROCESING #################### */ 101 p r i n t f ( \n ) ; 102 f p r i n t f ( f s t a t i s t i c, #%s \n#width=%d, h e i g h t=%d\n, argv [ 1 ], width, h e i g h t ) ; 103 p r i n t f ( \n ) ; 104 p r i n t f ( : ) ; s c a n f ( %d,& t a t e ) ; 105 p r i n t f ( : ) ; s c a n f ( %d,&yoko ) ; 106 i f ( tate <=0) /* Floating Exception Error */ 24

25 107 t a t e =1; 108 i f ( yoko<=0) 109 yoko =1; i f ( t a t e==1 && yoko==1){ 112 hb method ( 0, 0, width, h e i g h t ) ; 113 return ; 114 } yoko jump=width / t a t e ; 118 amari y=width%t a t e ; tate jump=h e i g h t /yoko ; 121 amari t=h e i g h t%yoko ; p r i n t f ( : %d\n, tate jump ) ; 125 p r i n t f ( : %d\n, yoko jump ) ; 126 f p r i n t f ( f s t a t i s t i c, #%d,%d,%d,%d\n, yoko, tate, yoko jump, tate jump ) ; 127 s t a r t=c l o c k ( ) ; 128 for ( i =0; i <h e i g h t ; i=i+tate jump ){ 129 y1=i ; y2=y1+tate jump ; 130 i f ( y2+amari t>=h e i g h t ){ 131 y2=h e i g h t ; i=h e i g h t ; 132 } for ( j =0; j<width ; j=j+yoko jump ){ 135 x1=j ; 136 x2=x1+yoko jump ; i f ( x2+amari y>=width ){ 139 x2=width ; j=width ; 140 } 141 p r i n t f ( (%4d%4d)(%4d%4d ),\ n, x1, y1, x2, y2 ) ; 142 f p r i n t f ( f s t a t i s t i c, %5d %5d %5d %5d, x1, y1, x2, y2 ) ; 143 hb method ( x1, y1, x2, y2 ) ; } 146 } p r i n t f ( \n ) ; 149 end=c l o c k ( ) ; 150 p r i n t f ( TIME: %.6 l f s e c \n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 151 f p r i n t f ( f s t a t i s t i c, #%.6 l f \n\n, ( double ) ( end s t a r t )/CLOCKS PER SEC ) ; 152 /* #################### WRITE DATA # #################### */ 153 k=0; 154 for ( i =0; i <h e i g h t ; i ++){ 155 for ( j =0; j<width ; j ++){ 156 k++; 157 f p r i n t f ( fout, %3d, g [ i ] [ j ] ) ; /* */ 158 i f ( k==17){ 159 f p r i n t f ( fout, \n ) ; 160 k=0; 161 } 162 } 163 } 164 /* ################### CLOSE FILE ####################### */ 25

26 165 f c l o s e ( f o u t ) ; 166 f c l o s e ( f i n ) ; 167 return ; 168 } /* ################################################## */ void hb method ( int x1, int y1, int x2, int y2 ){ int i =0, j =0; 175 int c l a s s l n u m =0, class rnum =0, c l a s s l a v e =0, c l a s s r a v e =0; 176 double tmp1=0.,tmp2 =0.; 177 double bun max =0.; 178 int height1 =0, width1 =0; h e i g h t 1=y2 y1 ; width1=x2 x1 ; for ( i =0; i <max+1; i ++){ 183 histogram [ i ]=0; 184 } p r i n t f ( \n ) ; for ( i=y1 ; i <y2 ; i ++){ /* */ 189 for ( j=x1 ; j<x2 ; j ++){ 190 histogram [ f [ i ] [ j ]]++; 191 } 192 } 193 /*2 */ 194 for ( i =0; i <(max+1); i ++){ 195 c l a s s l n u m=class rnum =0; 196 c l a s s l a v e=c l a s s r a v e =0; for ( j =0; j<i ; j ++){ 199 c l a s s l n u m+=histogram [ j ] ; 200 } class rnum=( height1 width1) c l a s s l n u m ; i f ( c l a s s l n u m==0) c l a s s l n u m =1; 205 i f ( class rnum==0) class rnum =1; /* */ 209 for ( j =0; j<i ; j ++){ 210 c l a s s l a v e+=histogram [ j ] j ; 211 } 212 c l a s s l a v e=c l a s s l a v e / c l a s s l n u m ; for ( j=i ; j <(max+1); j ++){ 215 c l a s s r a v e+=histogram [ j ] j ; 216 } 217 c l a s s r a v e=c l a s s r a v e / class rnum ; tmp1=1. c l a s s l n u m class rnum pow ( ( c l a s s l a v e c l a s s r a v e ), 2 ) ; 221 tmp2=1. pow ( ( c l a s s l n u m+class rnum ), 2 ) ;

27 223 i f ( bun max<(tmp1/tmp2 ) ) { 224 bun max=(tmp1/tmp2 ) ; 225 s i k i i t i =i ; 226 } 227 } p r i n t f ( %d\n, s i k i i t i ) ; 230 f p r i n t f ( f s t a t i s t i c, %5d\n, s i k i i t i ) ; 231 for ( i=y1 ; i <y2 ; i ++){ 232 for ( j=x1 ; j<x2 ; j ++){ 233 i f ( f [ i ] [ j ]> s i k i i t i ) 234 g [ i ] [ j ]=1; 235 else 236 g [ i ] [ j ]=0; 237 } 238 } 239 return ; 240 } : (FILE OPEN) (FILE HEADER) (PRE- PARE MEMORY) (READ DATA) (MAIN PROCCESSING)( ) (WRITE DATA) (CLOSE FILE)

28 3 2 2 H max H 2 T l Y l T r Y r : :2 :H max : 0 T l :H max :T r (H max ) 2 (H 2 ) (H max ) 14 2 R R T L T r T l T r 0 T l 32: 3 2 Y l T r Y r Y l Y r R 2 H max H f ij

29 i(i=1,2) ω i M, σ 2 M r σ 2 W = ω 1σ ω 2σ 2 2 ω 1 + ω 2 (1) σ 2 B = ω 1(M 1 + M r ) 2 + ω 2 (M 2 M 1 ) 2 ω 1 + ω 2 = ω 1ω 2 (M 1 M 2 ) 2 (ω 1 + ω 2 ) 2 (2) σ 2 T σ2 r = σ 2 w + σ 2 B σb 2 σw 2 = σ 2 B σ 2 T σ2 B (3) σ T σ 2 B W,H t s m = (int)(w/t), n = (int)(h/s), r t = W %t, r s = H%s( ) 33:

30 hb_method , %, 2 12%. 108,101 S /S (%) (s) : p- 30

31 3 2 H max H 2 T l Y l T r Y r : :2 :H max : 0 T l :H max :T r H max T l Y l T r Y r H 2 (s) : :

32 : (4 ) 2 ( ) ( ) (0,0) (101,69) 96 (0.0000) (101,0) (202,69) 110 (0,69) (101,138) 123 (101,69) (202,138) (0,0) (160,120) 102 (0.0000) (160,0) (320,120) 102 (0,120) (160,240) 97 (160,120) (320,240) 102 5: : p 2 32

33 ( 1 2 )

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

[ 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

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

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

P05.ppt

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

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

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

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

AHPを用いた大相撲の新しい番付編成

AHPを用いた大相撲の新しい番付編成 5304050 2008/2/15 1 2008/2/15 2 42 2008/2/15 3 2008/2/15 4 195 2008/2/15 5 2008/2/15 6 i j ij >1 ij ij1/>1 i j i 1 ji 1/ j ij 2008/2/15 7 1 =2.01/=0.5 =1.51/=0.67 2008/2/15 8 1 2008/2/15 9 () u ) i i i

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

: 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

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

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

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

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

2: 3: A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz A ( ( 4 ( 5 f(t = sin(2πf 1t + sin(2πf 2 t = 2 sin(2πt(f 1 + f 2 /2 cos(2πt(f 1 f

2: 3: A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz A ( ( 4 ( 5 f(t = sin(2πf 1t + sin(2πf 2 t = 2 sin(2πt(f 1 + f 2 /2 cos(2πt(f 1 f 12 ( TV TV, CATV, CS CD, DAT, DV, DVD ( 12.1 12.1.1 1 1: T (sec f (Hz T= 1 f P a = N/m 2 1.013 10 5 P a 1 10 5 1.00001 0.99999 2,3 1 2: 3: 12.1.2 A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz

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

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

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

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

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

2 1,384,000 2,000,000 1,296,211 1,793,925 38,000 54,500 27,804 43,187 41,000 60,000 31,776 49,017 8,781 18,663 25,000 35,300 3 4 5 6 1,296,211 1,793,925 27,804 43,187 1,275,648 1,753,306 29,387 43,025

More information

実験 7-1 画像処理基礎 2 1 目的 画像をコンピュータ上で処理するサイの基本事項について学ぶ 画像の変換 画像フィルタ 画像の特徴抽出とパターン分類などの具体的なプログラミングを試みることにより ディジタル画像処理の基本的な手順 手法及びシステム構成について理解する 2 解説 前回の実験と同様

実験 7-1 画像処理基礎 2 1 目的 画像をコンピュータ上で処理するサイの基本事項について学ぶ 画像の変換 画像フィルタ 画像の特徴抽出とパターン分類などの具体的なプログラミングを試みることにより ディジタル画像処理の基本的な手順 手法及びシステム構成について理解する 2 解説 前回の実験と同様 実験 7-1 画像処理基礎 2 1 目的 画像をコンピュータ上で処理するサイの基本事項について学ぶ 画像の変換 画像フィルタ 画像の特徴抽出とパターン分類などの具体的なプログラミングを試みることにより ディジタル画像処理の基本的な手順 手法及びシステム構成について理解する 2 解説 前回の実験と同様のため省略する -1- 3 実験 実験 3-1 2 値化 -1 2 値化処理を行って画像 Fの中の明るい

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

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

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

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

thesis.dvi

thesis.dvi 3 17 03SA210A 2005 3 1 introduction 1 1.1 Positronium............ 1 1.2 Positronium....................... 4 1.2.1 moderation....................... 5 1.2.2..................... 6 1.2.3...................

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

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

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0) E-mail: takio-kurita@aist.go.jp 1 ( ) CPU ( ) 2 1. a f(a) =(a 1.0) 2 (1) a ( ) 1(a) f(a) a (1) a f(a) a =2(a 1.0) (2) 2 0 a f(a) a =2(a 1.0) = 0 (3) 1 9 8 7 (x-1.0)*(x-1.0) 6 4 2.0*(x-1.0) 6 2 5 4 0 3-2

More information

1 5 13 4 1 41 1 411 1 412 2 413 3 414 3 415 4 42 6 43 LU 7 431 LU 10 432 11 433 LU 11 44 12 441 13 442 13 443 SOR ( ) 14 444 14 445 15 446 16 447 SOR 16 448 16 45 17 4 41 n x 1,, x n a 11 x 1 + a 1n x

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

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

実際の株価データを用いたオプション料の計算 2002 2 20 1 1 3 2 3 2.1 : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 2.1.1 : : : : : : : : : : : : : : : : : : : : 5 2.1.2 : : : : : : : : : : : : : : : : : : : : 6 2.2 : : : : : : : : : :

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

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

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

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

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

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

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1 () 2006 2 27 1 10 23 () 30 () 27 [1] p.97252 7 2 2.1 2.1.1 1 LIFO(last in first out, ) (push) (pup) 1 1: 2.1.2 1 List 4-1(p.100) stack[] stack top 1 2 (push) (pop) 1 2 void stack push(double val) val stack

More information

joho09.ppt

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

More information

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

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

LIFO(last in first out, ) 1 FIFO(first in first out, ) 2 2 PUSH POP : 1

LIFO(last in first out, ) 1 FIFO(first in first out, ) 2 2 PUSH POP : 1 2007 7 17 2 1 1.1 LIFO(last in first out, ) 1 FIFO(first in first out, ) 2 2 PUSH POP 2 2 5 5 5 1: 1 2 データの追加 データの取り出し 5 2 5 2 5 2: 1.2 [1] pp.199 217 2 (binary tree) 2 2.1 (three: ) ( ) 秋田高専 校長 準学士課程学生

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

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

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

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

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

データ構造とアルゴリズム論

データ構造とアルゴリズム論 15 10 14 Java jtextfielddata jbuttonwrite jlabelmessage void jbuttonwrite_actionperformed(actionevent e) { String Data=jTextFieldData.getText(); try { // Test1.txt fw FileWriter fw= new FileWriter("Test1.txt");

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

untitled

untitled 1. 2. 3. 4. 5. 6. 7. Intelligent Electronic Systems Group 4 PC bitmap.bmp (255,0,0)"" p8-2forint.c or p8-2formot.cdl (printf) (R,G,B)=(127,127,0) (R,G,B)=(255,127,0) viewer bitmap.bmp 1616 24bit (R,G,B)

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

j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E

j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E 8 9 7 6 4 2 3 5 1 j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E a n 1 H = ae l j, j=1 l j = x j+1 x j, x n x 1 = n 1 j=1 l j, l j = ±l l > 0) n 1 H = ϵ l j, j=1 ϵ e x x

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

compiler-text.dvi

compiler-text.dvi 2018.4 1 2 2.1 1 1 1 1: 1. (source program) 2. (object code) 3. 1 2.2 C if while return C input() output() fun var ( ) main() C (C-Prime) C A B C 2.3 Pascal P 1 C LDC load constant LOD load STR store AOP

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

XMPによる並列化実装2

XMPによる並列化実装2 2 3 C Fortran Exercise 1 Exercise 2 Serial init.c init.f90 XMP xmp_init.c xmp_init.f90 Serial laplace.c laplace.f90 XMP xmp_laplace.c xmp_laplace.f90 #include int a[10]; program init integer

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

r3.dvi

r3.dvi 00 3 2000.6.10 0 Java ( 7 1 7 1 GSSM 1? 1 1.1 4 4a 4b / / 0 255 HTML X 0 255 16 (0,32,255 #0020FF Java xclock -bg #0020FF xclock ^C (Control C xclock 4c 1 import java.applet.applet; import java.awt.*;

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

memo

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

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

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

Java学習教材

Java学習教材 Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("

More information

第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

上達Java解答.doc

上達Java解答.doc //[1] (1) package kihonproj; import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; public class Sikakumenseki extends JApplet { // public void paint(graphics g){ int tate

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

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

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

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

2

2 問題 1 次の設問 1~5 に答えよ 設問 1. Java のソースプログラムをコンパイルするコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 2. Java のバイトコード ( コンパイル結果 ) を実行するコマンドはどれか a) java b) javac c) javadoc d) jdb 設問 3. Java のソースプログラムの拡張子はどれか a).c

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

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

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

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

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

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

pptx

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

More information

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; 19 3!!...... (+) (>) (++) (+=) for while 3.1!! 3.1.1 50 20 20 5 (20, 20) 3.1.1 (1)(Blocks1.java) public class Blocks1 extends JApplet { public void paint(graphics g){ 5 g.drawrect( 20, 20, 50, 20); g.drawrect(

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

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

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

More information

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

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

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

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

: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

Javaセキュアコーディングセミナー東京 第3回 入出力(File, Stream)と例外時の動作 演習解説

Javaセキュアコーディングセミナー東京 第3回 入出力(File, Stream)と例外時の動作 演習解説 Java セキュアコーディングセミナー東京第 3 回入出力と例外時の動作 演習解説 2012 年 11 月 11 日 ( 日 ) JPCERT コーディネーションセンター脆弱性解析チーム戸田洋三 1 Hands-on Exercises コンパイルエラーに対処しよう ファイルからのデータ入力を実装しよう 2 Hands-on Exercise(1) サンプルコードの コンパイルエラーに対処しよう 3

More information

スライド 1

スライド 1 数値解析 2019 年度前期第 13 週 [7 月 11 日 ] 静岡大学創造科学技術大学院情報科学専攻工学部機械工学科計測情報講座 三浦憲二郎 講義アウトライン [7 月 11 日 ] 関数近似と補間 最小 2 乗近似による関数近似 ラグランジュ補間 T.Kanai, U.Tokyo 関数近似 p.116 複雑な関数を簡単な関数で近似する 関数近似 閉区間 [a,b] で定義された関数 f(x)

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

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

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

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information