|
|
|
- 境 卢
- 9 years ago
- Views:
Transcription
1
2
3 C, Win-TC Turbo C,,
4 C, C,,,, C C, : Win-TC C, 23,,, 15,, C Turbo C Win-TC Turbo C,,,,
5 W in -TC 1 Win-TC 1 1. Win-TC 1 2. Win-TC 1 3. Win-TC 1 2 Win-TC HTML 5 3 Win-TC
6 Win-TC ASCII DOS / / / * * / LIB 19 6 Win-TC 21 C 1 Win-TC
7 23 50 C C Turbo C
8 W in -TC 1 Win-TC 1. Win-T C ( 1 ) Win-TC, : Pentium133 CPU 32MB ( 64MB, 4GB) 2 GB, 850MB Win98 /Win2000 / Win XP ( 2 ) Windows Win-TC18, 2. Win-T C ( 1 ) Win-TC : Win-TC : ( ) Win-TC ( 2 ) Win-TC : Win-TC : : Alt + F4 : : 3. Win-TC Win-TC, 1. 1
9 1. 1 Win-TC ( 1 ),, noname. c ( 2 ) Win-TC 5,, Win-TC 1. 2 ( 3 ) Win-TC, ( 4 ), Win-TC, ( 5 ), ( 6 ), ( 7 ),
10 Win-TC 1. 2 Win-TC 2 Win-TC 1. : : Ctrl + N : 2. 3 :
11 : Ctrl + O : 3. ( 1 ) : : Ctrl + S : ( 2 ) : 4. ( 1 ) : : ( 2 ) BGI ( ) : BGI : BGI 5. ( 1 ) Win-TC : : ( 2 ) Windows : Windows ( ) 6. ( 1 ) Win-TC :
12 Win-TC : ( 2 ) Windows : Windows ( ) 7. ( 1 ) Win-TC : : ( 2 ) Windows : Windows ( ) 8. ( 1 ) Win-TC : : ( 2 ) Windows : Windows ( ) 9. ( 1 ) Win-TC :... :... ( 2 ) Windows : Windows ( ) 10. HTML 5 : HTML
13 3 Win-TC 1. Win-TC,, ( 1 ) : ( ), ( ),,, ( 2 ) : ( ),, Shift ( ) :, Shift,,, ( 3 ) : Ctrl + A : :,, 2.,, : : : Ctrl + C : 3.,, :
14 Win-TC : : Ctrl + X : 4. ( ),, Del : 5.,, : : : Ctrl + P : 6. ( ), ( ), : ( ) : trl + F( ) : ( ) 7. ( ), ( ), : ( ) ( ) 7
15 : ( ) ( ) 8.,,, :, 9. ( ), Win-TC :
16 Win-TC ( 1 ) : : 3232, : 1616, Win-TC, : 4, : N, 0 N 4,, 0001, 1 Win-TC noname. c : Win-TC project noname. c : : Win-TC,, C : 99,, 999 :, ( pixel) ( 2 ) ( ) ( 3. 2 ), ; ( ) ; 9
17 3. 2 ( ) ( ) ,, Win-TC ( 3 ) ( 3. 3 ), VC, VC TAB, TAB ( TAB ) Win-TC,, 4
18 Win-TC 3. 3 ( 4 ) ( 3. 4 )
19 ,,. tpl, Win-TC, :,, 4 1. ( ),, ( ), ( obj ) ( exe ),,, : : F9 :, ;,,,, 4. 1 ; , ( exe ), : : Windows
20 Win-TC : : Win-TC : : Ctrl + F9 : 3., : 4., : 4. 3, 5, ( 1 ), 6 :, 64K,, CS = DS = SS = ES near.exe DOS EXE2 BIN.COM : 64K, 64K 13
21 4. 3, DS = SS = ES near : 64K, near 64K( 1M), far : 64K, far 64K, near, 64K, far : far, 1MB, 64K : far,,, Turbo C 64K, 64K
22 ( 2 ) : : : : ( 3 ) Win-TC Turbo C 2 Turbo C Turbo C 2 : Turbo C 2, Turbo C : Turbo C 2. 01, ( 4 ) FOR Turbo C 2 LIB LIB, LIB,, 10 LIB, LIB Win-TC ( 5 ) : / * * /, : / * aa / * bb * / cc * / :,, ASM,. exe. obj. exe, Obj : C. obj Map : C. map :, :,, / / : 15
23 :,, 5 Win-TC 1. ASCII Win-TC ASCII, ASCII ASCII : Alt + ASCII ASCII : ASCII ASCII ASCII
24 Win-TC 2. Win-TC,, EXE ( 5. 2 ),, DOS, 16 16, 6, : void drawmat( char * mat, int matsize, int x, int y, int color) / * : ( x, y) * / { nt i, j, k, n; n = ( matsize - 1) /8 + 1 ; for( j = 0; j < matsize; j + + ) for( i = 0; i < n; i + + ) for( k = 0; k < 8; k + + ) if( mat[ j* n + i] &( 0x80 > > k) ) / * 1 * / 17
25 putpixel( x + i* 8 + k, y + j, color) ; 3. DOS : CCDOS, PDOS95, Windows 98 PDOS95 DOS Windows 2000 Windows XP, PDOS95 DOS, UCDOS, Win-TC DOS, DOS DOS, DOS DOS,, EXE ( 5. 3 ) DOS,,, DOS,, DOS, 32 PE 16 NE,, DOS EXE 5. 3 DOS
26 Win-TC 4. / //* * / Win-TC C + +, / / Win- TC / / / /, #include / /, #include/ /,, / /, /* * / TC2 TC2, / // * * // / / * * /, TC2 5. LIB ( 1 ) Turbo C,, Win-TC, ( LIB) LIB FOR Turbo C FOR Visual C FOR Turbo C, (, *. h ) Win-TC include, *. lib lib, Win-TC, LIB,, ( 2 ) LIB LIB LIB? : ( OBJ) mylib / * * * * * mylib. c * * * * * / void myfun( ) { printf( \ nmyfun( ) in mylib. lib \ n ) ; Win-TC mylib. c OBJ,, 19
27 , ( F9 ) : LIB ( LIB) Win-TC mylib. obj Win-TC BIN, makelib. bat, : Tlib mylib. lib + mylib. obj, BIN mylib. lib : ( *. h) LIB BIN mylib. lib Win-TC lib mylib. lib,, : Win-TC, :void myfun( ) ;, #ifndef... #define... #endif, MYLIB, : #ifndef #define MYLIB MYLIB void myfun( ) ; #endif,, ( *. h), Win-TC INCLUDE,, mylib, INCLUDE mylib. h : LIB : #include mylib. h / * * / { yfun( ) ; getch( ) ; Ctrl + F9, : myfun( ) in mylib. lib, LIB
28 Win-TC 6 Win-TC ; ( ; ) ;, ; 1 Win 2000 Win XP Win-TC Win 2000 Win XP,,, getch( ), { printf( This is a TurboC. ) ; : { printf( This is a TurboC. ) ; getch( ) ;, :, 21
29 C 1 Win -TC 1. C 2. Win-TC 3. C 1. Win-TC, Win-TC 2. Win-TC 3. Win-TC, Win-TC 4. Win-TC 5. Win-TC 6. Win-TC 7. : #include stdio. h { printf( This is C program! ) ; ( 1 ) ( 2 ), ( 3 ), : I am a student! ( 4 ), : I am a student!
30 C 2 1. C 2. C 3. C 1. ( 1 ) printf( % d, 2 /3) ; ( 2 ) printf( % f, 2. 0 /3) ; ( 3 ) printf( % d, 2 /3* 100) ; ( 4 ) printf( % f, 2. 0 /3* 100) ; ( 5 ) printf( % d, 2 / ( 3* 100) ) ; ( 6 ) printf( % f, 2. / ( 3* 100) ) ; ( 7 ) printf( % d, 2. / ( 3* 100) ) ; ( 8 ) printf( % d, 2% 3) ; ( 9 ) printf( % d, 3% 2) ; ( 10) printf( % d, 3. 0% 2 ) ; 2. ( 1 ) = 3; j = 3 ; j = ( i + + ) + ( i + + ) + ( i + + ) ; printf( i = % d, j = % d, i, j) ; ( 2 ) = 3; j = 3 ; j = ( + + i) + ( + + i) + ( + + i) ; printf( i = % d, j = % d, i, j) ; ( 3 ) = 3; printf( a = % d \n, a) ; printf( a = % d \ n, a + + ) ; printf( a = % d \ n, + + a) ; 23
31 ( 4 ) printf( % d, ) ; ( 5 ) printf( % ld, ) ; ( 6 ) printf( % f, ) ; ( 7 ) printf( % 12. 4f, ) ; 3. ( 1 ) printf( % d, + + 4) ; ( 2 ) i = 3; j = 4 ; printf( % d, + + ( i + j) ) ; ( 3 ) i = 3; printf( % d, + + i + + ) ; ( 4 ) i = 3; printf( % d, i) ; ( 5 ) printf( % d, 5. 0% 3) ; ( 6 ) printf( % d, 5. 0% 3. 0) ; 4. ( 1 ) x = 4; x = 4 * 6, x* 5; x? ( 2 ) x = 4; x = ( 4* 6, x* 5 ) ; x? ( 3 ) a = 12; a + = a - = a* = a; a? ( 4 ) z = 7; z = 3 * z - - ; z? 5. ( 1 ) { nt i, j, m, n; i = 8; j = 10; m = i + + ; n = + + j; printf( % d, % d, % d, % d, i, j, m, n) ; 5 6 m = + + i; n = j + + ;? ( 2 ) define AMT a + a + a #define ATT AMT - AMT { nt a = 2; printf( % d, ATT) ;
32 C 3 1. C 2. printf( ) 3. scanf( ) 4. putchar( ) getchar( ) 1. : #include stdio. h { har m = 97, n; n = getchar( ) ; putchar( m) ; putchar( n) ; ( 1 ) ( 2 ) 1,? 2. : { nt a = - 1; printf( % d, a) ; printf( % u, a) ; ( 1 ) ( 2 ) a = - 2,?? 3. : { nt a = 20; 25
33 printf( % d, a) ; printf( % o, a) ; printf( % x, a) ; ( 1 ) ( 2 ) a = - 2,?? 4. : { nt a = 20; float b = ; printf( % - 5d#, % d* % 06. 2f, a, a, b) ; 5. : { nt a; float b; scanf( %, % d, a, b) ; printf( % d* % d, a, b) ; ( 1 ), ( 2 ) 4 : scanf( % o, % f, a, b) ;, 6. : { nt a, b; scanf( % 2d% * 3d% 2 d, &a, &b) ; printf( % d* % d, a, b) ; ( 1 ), , ( 2 ) 3 : scanf( % 3d% 3d, &a, &b) ;,?
34 C 1.,? 2. printf( ) scanf( ) if if... else ( 1 ) nt a; a = 5 > 3; printf( % d, a) ; ( 2 ) printf( % d,! 9) ; ( 3 ) nt a = 1, b = 2, c = 3, d = 4, m, n = 1; ( m = a > b) &&( n = c > d) ; printf( m = % d, n = % d, m, n) ; 2., { nt x = 1, y = 1, z = 1; y = y + z; x = x + y; printf( % d \ n, x < y? y: x) ; printf( % d \ n, x < y? x + + : y + + ) ; printf( % d \ n, x) ; printf( % d \ n, y) ; 27
35 x = 3; y = z = 4; printf( % d \ n, x > = y > = x? 1: 0) ; printf( % d \ n, z > = y&&y > = x) ; 3., ( 1 ) ain( ) { nt x; if x = 2) el e ( 2 ) ain( ) printf( all right! ) ; printf( it is wrong! ) ; { nt x; scanf( % d, &x) ; if( 2) else ( 3 ) ain( ) printf( all right! ) ; printf( it is wrong! ) ; { nt x = 3, y = 4, z = 5, ; if x < z) el e printf( % d, x + + ) ; if( y < z) else printf( % d, + + y) ; printf( % d, + + z) ; 4. ax 2 + bx + c = 0 : 1) a = 0,, x = - c / b ( 2) a = b = 0,
36 C ( 3) a0 : b 2-4ac > 0, ; b 2-4ac = 0, ; b 2-4ac < 0, 5. 3 a, b, c, : 1) a, b, c 0, ; ( 2), ; ( 3), ; ( 4) area = s( s - a) ( s - b) ( s - c), s = ( a + b + c) /2 6. : x 2-1, x < 0, y = 0, x = 0, x 2 + 1, x > 0, y, x 5 2 switch 1., { int x = 1, y = 0 ; switch( x) { case 1 : switch( y) { case 0 : rintf( * * 1* * \ n ) ; break; 29
37 , : case 1: printf( * * 2* * \n ) ; break; case 2: printf( * * 3 * * \ n ) ; 2.,, s s > 100, 95 ; s > 300, 90 ; s > 500, 80 ; s > 1 000, 75 ; s > 3 000, 70 switch( ) if... else..., 6 1 while( ) 1., { int a = 1, b = 2, c = 2, t; while( a < b < c) { t = a; a = b; b = t; c - - ; printf( % d, % d, % d, a, b, c) ; 2. m n, 3. s = 1! + 2! + 3! !
38 C 7 2 do... while( ) ) 1., { nt x = 0, y = 0 ; do { y + + ; x + = + + y; while( x < 18 ) ; printf( % d, % d, x, y) ; ( 3. s = n ( n = ) 8 3 for 1., { nt x = 1, y = 2, z = 3; for( ; < = 105; x + +, y + + ) 31
39 z = x* y* z; printf( % d, % d \n, x, y) ; 2. e, 10-6 e = /1! + 1 /2! / n! 3.,,, 128,,,,,,,,,,, 64,,,,,,, 1,,,,, C, 9 4 continue break 1. break, s = continue, , :,,,? 1. 2.?
40 C 3.,? 4.,? , #include stdio. h { nt i, c[ 5 ] ; int a[ ] = {9, 7, 5, 3, 1 ; int b[ ] = { - 2, - 4, - 6, - 8, - 10 ; f r( i = 0 ; i < 5; i + + ) c[ i] = a[ i] + b[ i] ; for( i = 0; i < 5 ; i + + ) printf( % 8d, c[ i] ) ; 2. 40, ( )
41 , #include stdio. h { nt a[ 3] [ 3] = {1, 2, 3, 4, 5, 6, 7, 8, 9, i, x = 0 ; for( i = 0; i < = 2 ; i + + ) x + = a[ i] [ i] ; printf( % d \ n, x) ; , (, ) 4. ( 9 ) :
42 C 2. 1., #include stdio. h { har a[ ] = { a, b, c, d, \0, x, y, z, \0 ; printf( % s, a) ; 2. #include stdio. h { har a[ 5 ], b[ 5] ; int i; for( i = 0; i < 5 ; i + + ) scanf( % c, a[ i] ) ; scanf( % s, b[ i] ) ; printf( % s\ n% s \n, a, b) ; 3. ( * ) * * * * * * * * * * * * * * * * * * * * * * * * *
43 1., #include stdio. h int fun1( ) { int x = 5; printf( % d \ t, x) ; return x; int fun2( int x) { printf( % d \ t, + + x) ; return x; { int x = 2; x = fun1( ) ; x = fun2( x) ; printf( % d \ n, x) ; 2.,, #include stdio. h { nt x = 4, y = 2 ; printf( % d \ n, mm( x* y) ) ; int mm( u, v) { int u, v; return( u* v) ; 3., f( x) = x 2 + 1, x > 1, x 2, - 1x1, x 2-1, x < - 1 double fun( double x)
44 C 4. ax 2 + bx + c = 0, b 2-4ac a, b, c 5. n! ( n = 10) n! = 1, n = 1, ( n - 1)!n, n > 1 6. n, : 1, n = 0, P n ( x) = x, n = 1, [ ( 2 n - 1) x - P n - 1 ( x) - ( n - 1) P n - 2 ( x) ] /n, n > , ( 1 ) include stdio. h void fun1( ) { nt x = 5; printf( % d \ t, x) ; void fun2( int x) { printf( % d \ t, + + x) ; { nt x = 2; fun1( ) ; fun2( x) ; 37
45 printf( % d \ n, x) ; ( 2 ) include stdio. h int x, y; { = 5 ; f( x) ; f( x) ; getch( ) ; int f( int x) { = x + + ; printf( % d \ n, y) ; ( 3 ) include stdio. h int x, y; { = 5 ; f( ) ; f( ) ; getch( ) ; int f( ) { = x + + ; printf( % d \ n, y) ; ( 4 ) include stdio. h int x, y; { = 5 ; f( x) ; f( x) ; getch( ) ; int f( ) { = x + + ; printf( % d \ n, y) ;
46 C ( 5 ) include stdio. h int x, y; { = 5 ; f( x) ; f( x) ; getch( ) ; int f( x) { = x + + ; printf( % d \ n, y) ; , #define MAX( a, b) ( ( a) > ( b)?( a) : ( b) ) 2., ( a) > ( b),?? 3., 4., f1. c, #define MAX( a, b) ( ( a) > ( b)?( a) : ( b) ) #include stdio. h 1, #include f1. c, 39
47 , 5., #define LETTER 1 { har str[ 20] = C language, c; int i; i = 0; while( ( c = str[ i] )! = \0 ) { i + + ; #if LETTER #else #endif printf( % c, c) ; if( c > = a &&c < = z ) c = c - 32; if( c > = A &&c < = Z ) c = c + 32; #include stdio. h { nt a; int * p; p = &a; scanf( % d, &a) ;
48 printf( % d \ n, a) ; C :, 2., #include stdio. h / * 3, * / { nt a, b, c; int * p1, * p2, * p3; scanf( % d, % d, % d, &a, &b, &c) ; p1 = &a; p2 = &b; p3 = &c; if( a > b) swap( p1, p2) ; if( a > c) swap( p1, p3) ; if( b > c) swap( p2, p3) ; printf( % d, % d, % d, a, b, c) ; swap( int * p1, int * p2) { nt x; ( 1 ), ( 2 ) : swap *,?? 3., #include stdio. h sub( int x, int y, int * z) { * z = y - x; { nt a, b, c; sub( 10, 5, &a) ; sub( 7, a, &b) ; sub( a, b, &c) ; printf( % 4d, % 4 d, % 4d \ n, a, b, c) ; 41
49 : int a[ 10] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, i = 0; int * p; ( 1 ) p? ( 2 ) 2. p,? ( 1 ) * p; ( 2 ) * ( p + + ) ; ( 3 ) * p + + ; ( 4 ) * ( p + + ) * ( + + p), * ( p + + ) a [ i + + ]? 3. : 10,, { nt number[ 10 ] ; int * p, i; printf( input 10 numbers: ) ; fo ( i = 0 ; i < 10; i + + ) scanf( % d, &number[ i] ) ; maxminvalue( number) ; printf( New order: ) ;
50 C for( p = number; p < = number + 9; p + + ) printf( % d, * p) ; maxminvalue( int array[ 10] ) { nt * max, * min, * p, * end; end = array + 9; max = min = array; for( p = array + 1; p < = end; p + + ) if( * max < * p) max = p; * p = array[ 9] ; array[ 9] = * max; * max = * p; f r p = array + 1; p < = end; p + + ) if * min > * p) min = p; return; , 33, { nt a[ 3] [ 3], * p, i; printf( input matrix: \ n ) ; for( i = 0; i < 3 ; i + + ) scanf( % d% d% d, &a[ i] [ 1], &a[ i] [ 2 ], &a[ i] [ 3] ) ; p = &a[ 0] [ 0] ; 43
51 for( i = 0; i < 3 ; i + + ) for( j = 0; j < 3 ; j + + ) = * ( p + 3* i + j) ; * ( p + 3 * i + j) = * ( p + 3* j + i) ; * ( p + 3 * j + i) = t; printf( New matrix: \n ) ; for( i = 0; i < 3 ; i + + ) printf( % d% d% d \ n, a[ i] [ 0], a[ i] [ 1], a[ i] [ 2] ) ; 2., #include stdio. h #include string. h chnum( char * p) { nt num = 0 ; fo ( ; * p! = \0 ; p + + ) num = num* 10 + * p- 0 ; return( num) ; { har s[ 8 ] ;
52 C int n; gets( s) ; if( * s = = - ) n = - chnum( s + 1) ; else n = chnum( s) ; printf( % d \ n, n) ; ( 1 ) < >,? ( 2 ) 2345 < >,? 2. strcmp( ), #include stdio. h { nt n; char s1[ 10], s2[ 10 ] ; char * p, * q; printf( input 2 strings: \ n ) ; gets( s1) ; gets( s2) ; p = s1; q = s2; n = strcmp( p, q) ; printf( result: % d \n, n) ; nt strcmp( char * p, char * q) { nt i = 0, m; while( * ( p + i) = = * ( q + i) ) { f( break; i + + ; m = * ( p + i) - * ( q + i) ; return( m) ; ( 1 ) rechard < > rechard < >,? ( 2 ) rechard < > heland < >,? 45
53 ( 3 ) heland < > rechard < >,? ( 4 ), :, #include stdio. h stru t yymmdd { nt day; int month; int year; data; { nt days( int, int, int) ; int i, daysum; printf( please input year - month - day: ) ; scanf( % d, % d, % d, &data. year, &data. month, &data. day) ; daysum = days( data. year, data. month, data. day) ; printf( \ nthe dayth is % d \n, daysum) ; days( int year, int month, int day) / * * / { nt daysum, i; int tt[ 13 ] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ;
54 C daysum = 0; for( i = 1; i < month; i + + ) daysum = daysum + tt[ i] ; if( onth >= 3&&( year% 4 = = 0&&year% 100! = 0 year% 4 == 0) ) daysum + = 1; return( daysum) ; 2. : a b,, a b,, #include stdio. h struct ; tudent{ char num[ 10 ] ; float cj; struct student * next; { truct student a[ 4] = { { 001, 90, { 002, 85, 003, 91, { 004, 76 ; struct student b[ 5] = { { 005, 85, 006, 68, { 003, 91, int i, j; { 008, 64, { 007, 78 ; struct student * p, * p1, * p2, * pt, * head1, * head2 ; head1 = a; /* * / head2 = b; printf( list a: \ n ) ; for p1 = head1, i = 1; p1 < a + 4; i + + ) { = p1; p1 - > next = a + i; printf( % 8 s% 8. 1 f\ n, p1 - > num, p1 - > cj) ; p1 = p1 - > next; 47
55 p - > next = 0; printf( list b: \ n ) ; for p2 = head2, i = 1; p2 < b + 5; i + + ) { = p2; p2 - > next = b + i; printf( % 8 s% 8. 1 f\ n, p2 - > num, p2 - > cj) ; p2 = p2 - > next; printf( \ n ) ; p1 = head1; /* * / while( p1! = 0) { 2 = head2; while( p2! = 0&&strcmp( p1 - > num, p2 - > num)! = 0) p2 = p2 - > next; if strcmp( p1 - > num, p2 - > num) = = 0) if( p1 = = head1) head1 = p1 - > next; else p - > next = p1 - > next; p = p1 ; p1 = p1 - > next; p1 = head1; /* * / printf( \ n result: \ n ) ; while( { printf( % 8s% 8. 1f\ n, p1 - > num, p1 - > cj) ; 1 = p1 - > next;
56 C union study { nt i[ 2] ; x; float a; long b; char c; { canf( % d, % d, &x. i[ 0 ], &x. i[ 1 ] ) ; printf( i[ 0] = % d, i[ 1] = % d, a = % f, b = % ld, c = % c \ n, x. i[ 0], x. i[ 1], x. a, x. b, x. c) ; 1000, 2000, : scanf( % ld, &x. b) ; printf, 60000,??
57 ( : 16, 0) { nsigned int a, b; int n1, n2; printf( input a octal number: ) ; scanf( % o, &a) ; printf( input n1, n2 ) ; scanf( % d, % d, &n1, &n2) ; b = 0; b = ( b > > n1) &( b < < ( 16 - n2 ) ) ; b = a&b; b = b > > ( 16 - n2) ; printf( result: % o \n, b) ; < > 5, 10 < >, < > 5, 10 < >, : #include stdio. h
58 { ILE * p; char ch, filename[ 10] ; scanf( % s, filename) ; if ( p = fopen( filename, w ) ) = = NULL) { rintf( cannot open file \n ) ; exit( - 1 ) ; while( ( ch = getchar( ) )! = \ n ) fputc( ch, p) ; fclose( p) ; ( 1 ) head1. c < > ) welcome to c < > C ( ), ( 2 ) wr, while : while( ( ch = fgetc( p) )! = EOF) putchar( ch) ; head1. c < >, 2., 51
59 C 1 1. C ( ) ( ) ( ) 2. C ( ) ( ) ( ) 3. C ( ) 4. C ( ) 5. C ( ) 6. int a; a ( ) float x; x ( ) char u; u ( ) 7. C int ( ), float ( ), char ( ) 8. int x = 6;, x% 2 + ( x + 1) % 2 ( ) 9. int x;, x = 25 /3% 3 ( ) 10. int a = 6;, a + = a - = a* a ( ) 11. int a;, ( a = 4* 5, a* 2), a + 6 ( ) 12. int x, a;, ( 1) x ( ), ( 2 ) x ( ) ( 1 ) x = ( a = 4, 6* 2) ( 2) x = a = 4, 6* char ch;, ch = a ( 14. C ( ) 15. C ( ) 16. C ( ) 17. C, LEI lei ( ) ) 18. int float char ( ) ( )
60 ( ) ( ) ( C 19. int x;, scanf( % f, x) ; x, ( ) ( ) 20. int a, b scanf( ) ( ) 21. int a, b, 5, printf( ) ) 22. float x, y, 6, 2, printf( ) ( ) 1. C ( ) A) ) C) D) 2. ( ) A) A P 0 do B) float 1a0 A C) b - a goto int 3. ( ) A) 160-0xffff 011 B) - 0xcdf 01a 0xe C) ( ) D) 123 temp INT D) - 0x48a 2e5 A) + 1e + 1 B) C) 123e D) - e3 5e e e e e2-8e5 + 2e e ( ) A) \ \ \ \ n B) \ \017 \ 6. ( ) C) \018 \ f \ xab 0x D) \ \0 A) lei B) y + x C) minx. D) aax* 7. ( ) \101 \ x1f A) aaa B) ax1 C) 9 xx D) max 2 8. ( ) A) short a = 1 -. le - 1; B) double b = 1 + 5e2. 5; 53
61 C) long do = 0xfdaL; D) float 2 and = 1 - e - 3; 9. C, ( ) A) B), C) D) 10. ( ) A) x B) W C) D) XYZ 11. ( ) A) x B) ABC C) ABC D) C, ( ) A) + + B) / C) % D) * 13. int a = 5, y; y = a + + ;, a, y ( ) A) a = 6, y = 5 B) a = 6, y = 6 C) a = 6, y = 7 D) a = 5, y = C ( ) A) ( ) B) [ ] C) { D) 15. int k, a, b; unsigned long w = 5; double x = 1. 42;, C ( ) A) x% ( - 3 ) B) w + = - 2 C) k = ( a = 2, b = 3, a + b) D) a + = a - = ( b = 4) * ( a = 3) 16. int a = 7; float x = 2. 5, y = 4. 7 ;, x + a% 3 * ( int) ( x + y) % 2 /4 ( ) A) B) C) D) : char w; int x; float y; double z;, w* x + z - y ( ) A) float B) char C) int D) double 18. int, 7 ( ) A) ( x = y = 6, x + y, x + 1 ) B) ( x = y = 6, x + y, y + 1 ) C) ( x = 6, x + 1, y = 6, x + y) D) ( y = 6, y + 1, x = y, x + 1) 19. 3ae, C ( ) bc A) a / b / c* e* 3 B) 3 * a* e / b /c C) 3* a* e /b* c D) a* e /c / b* scanf( ) ( ) A) % f B) % u C) % o D) % c 21. int a, b = 5;, a ( )
62 A) = a; B) scanf( % d, &a) ; C) a = ( b + 6 ) /3; D) a = c ; 22. int a; &a ( ) A) B) a C) a D) 1. int a; a = 90000; 2. char c; c = y ; 3. int a, b; scanf( % D, % D, &a, &b) ; 4. int a = 10 ; float x = 1. 25; printf( % f, % d, a, x) ; 5. int i = j = k = 0; 1. ain( ) { nt x = 1, y = 1; 2. ain( ) x = x + y; y = x + y; printf ( x = % d y = % d \ n, x, y) ; { nt x = 7, a = 2, b = 2, c; c = x /a% b; printf( c = % d \n, c) ; 1., C 55
63 2., C = 5 9 ( F - 32) * / 3. a b, av, s1 s2 #include math. h / * sqrt( ), math. h 4., v 0 q g = 9. 8 s( s = 2v 2 0 sinqcosq / g) 2 1. A ASCII 65, ( ) { har ch1, ch2 ; ch1 = A ; ch2 = A ; printf( % d, % c \ n, ch1, ch2) ; A) 67, D B) 3, C C) C, D D)
64 C 2. ( ) { nt x = f ; printf( % c \n, A + ( x - a + 1) ) ; A) G B) H C) I D) J 3. ( ) # include < stdio. h > { nt a, b, d = 241; a = d /100% 9; b = ( - 1) * ( - 1) ; printf( % d, % d \ n, a, b) ; A) 6, 1 B) 2, 1 C) 6, 0 D) 2, 0 4. ( ) { ouble d = 3. 2 ; int x, y; x = 1. 2; y = ( x ) /5. 0; printf( % d \n, d* y) ; A) 3 B) 3. 2 C) 0 D) sizeof( double) ( ) A) B) C) D) 6. printf( a \bre \ hi \ y \ \ \ bou \ n ) ; ( ) A) a \ bre \ hi \ y \ \ \bou C) re hi you B) a \ bre \ hi \ y\ bou D) abre hi y \ bou 7., ( ) A) + + t; B) n1 = ( n2 = ( n3 = 0) ) ; C) k = i = = j; D) b + c = 1; 8. : int i = 65536; printf( % d \n, i) ; 57
65 ( ) ( ) A) B) 0 C), D) ( ) { nt x = 10, y = 3; printf( % d \n, y = x/ y) ; A) 0 B) 1 C) 3 D) 10. ( ) { nt a = 12, b = 12; printf( % d, % d \ n, a - -, b + + ) ; A) 11, 12 B) 12, 11 C) 12, 12 D) 11, ( ) { nt a = 12, b = 12; printf( % d % d \n, - - a, + + b) ; A) B) C) D) int x = 11;, ( x + +* 1 /3) ( ) A) 3 B) 4 C) 11 D) x int, x = 10 ; x + = x - = x - x;, x A) 10 B) 20 C) 40 D) x, y, z k int, x = ( y = 4, z = 16, k = 32), x ( ) A) 4 B) 16 C) 32 D) x y int, x = 100, y = 200, : printf( % d, ( x, y) ) ; ( ) A) 200 B) 100 C) D),
66 C 16. x y int, x + = y; y = x - y; x - = y; ( ) A) x y B) x y C) D) x y 3 1. ( ) { ouble d; float f; long l; int i; i = f = l = d = 20 /3; printf( % d % ld %. 1f %. 1 f\n, i, l, f, d) ; A) B) C) D) : 123 < > 456 < > 789 < >, ( ) { har s[ 100] ; int c, i; scanf( % c, &c) ; scanf( % d, &i) ; scanf( % s, s) ; printf( % c, % d, % s \ n, c, i, s) ; A) 123, 456, 789 B) 1, 456, 789 C) 1, 23, 456, 789 D) 1, 23, ( ) { nt k = 17; printf( % d, % o, % x \n, k, k, k) ; A) 17, 021, 0 x11 B) 17, 17, 17 C) 17, 0x11, 021 D) 17, 21, 11 59
67 4. ( ) { int k = 11; printf( k = % d, k = % o, k = % x \ n, k, k, k) ; A) k = 11, k = 12, k = 11 B) k = 11, k = 13, k = 13 C) k = 11, k = 013, k = 0xb D) k = 11, k = 13, k = b 5., a1, a2, c1, c2 10, 20, A, B,, ( int a1, a2; char c1, c2 ; scanf( % d% d, &a1, &a2) ; scanf( % c% c, &c1, &c2) ; A) 1020AB < > B) 0 20 < > AB < > ) ( ) C) AB < > D) AB < > 6., ( ) : float f1, f2; : A) scanf( % f, % f, &f1, &f2) ; B) scanf( % f% f, &f1, &f2 ) ; C) scanf( % 3. 2f % 2. 1 f, &f1, &f2) ; D) scanf( % 3. 2f% 2. 1f, &f1, &f2) ; 7., : 25, 13, 10 < >, ( ) { nt x, y, z; scanf( % d% d% d, &x, &y, &z) ; printf( x + y + z = % d \ n, x + y + z) ; A) x + y + z = 48 B) x + y + z = 35 C) x + z = 35 D) 8., ( )
68 C { nt x; float y; printf( enter x, y: ) ; enter x, y: x + y = A) canf( % d, % f, &x, &y) ; printf( \ nx + y = % 4. 2f, x + y) ; B) canf( % d% f, &x, &y) ; printf( \ nx + y = % 4. 2f, x + y) ; C) canf( % d% f, &x, &y) ; printf( \ nx + y = % 6. 1f, x + y) ; D) canf( % d% 3. 1 f, &x, &y) ; printf( \ nx + y = % 4. 2f, x + y) ; 4 ( 1. C, ( ), ( ) 2. C ( ), ( ) 3. ( ) 4. ( ) 5. ( ) 6. ) 7. a, b, : ( 1 ) a&&b ( ) ( 2 )! ( a b) &&a ( ) ( 3 )! a b ( ) ( 4 ) ( a&&! b) ( b&&! a) ( ) 8. int a, b, c;, a b c ( ) 9. int a, b, c;, a, b, c 0 ( ) < = x < = 100 x < ( ) 61
69 11. a, b, c, ( ), ( ) 12. int x = 5, y = 6, z = 1;, : ( 1 ) x + y && z ( ) ( 2 ) x + y > 8 && x - y > 1 ( ) ( 3 ) x + y > 8 x - y > 1 ( ) ( 4 ) z = = y > 0 ( ) ( 5 )! x < z ( ) > 3 && 2 8 < 4 -! 1 ( ) 14. int a = 1, b = 2;, ( a < b? a: b) ( ) 15. switch break ( ) 1. C, > = ( ) A) B) C) D) 2., ( ) A)! B) && C) + D) 3., ( ) A)! B) && C) + D) 4. int a = 2, b = 5;, a + 5 > b + 3 ( ) A) 0 B) 1 C) D) 5. : int a = 1, b = 2, c = 3, d = 4, m = 2, n = 2; : ( m = a > b) &&( n = c > d), n ( ) A) 1 B) 2 C) 3 D) 0 6. x, y, z, t int, x = y = z = 1; t = + + x + + y&& + + z;, t ( ) A) B) 2 C) 1 D) 0 7. a 0 ( ) A) a < > 0 B)! a C) a = 0 D) a! = 0 8. a10 a0 ( ) A) a > = 10 or a < = 0 B) a > = 10a < = 0 C) a > = 10a < = 0 D) a > = 10 &&a < = 0 9. int x = 1, y = 1;, (! x y - - ) ( )
70 C A) 0 B) 1 C) 2 D) a b ( ) A) ( a > = 0 b > = 0 ) &&( a < 0b < 0) B) ( a > = 0&&b > = 0) &&( a < 0&&b < 0) C) ( a + b > 0 ) &&( a + b < = 0) D) a* b > ( ) { nt x = 100, a = 10, b = 20, ok1 = 5, ok2 = 0 ; if( a < b) if b! = 15) if(! ok1) x = 1; el e if( ok2 ) x = 10; else x = - 1; printf( % d \ n, x) ; A) - 1 B) 0 C) 1 D) 12. a = 1, b = 3, c = 5, d = 4,, x ( ) if( a < b) if( c < d) x = 1; else f a < c) else x = 7; if( b < d) x = 2; else x = 3; else x = 6; A) 1 B) 2 C) 3 D) y = ( x > 0? 1: x < 0? - 1: 0 ) ; if ( ) A) f ( x > 0) y = 1; else f( x < 0) y = - 1; B) ( x) else y = 0; if( x > 0) y = 1; else f( x < 0) y = - 1; 63
71 C) = - 1 if x) D) = 0 ; else y = 0 ; if( x > 0 ) y = 1; else if( x = = 0 ) y = 0; else y = - 1; i ( x > = 0) i ( x > 0) y = 1; else y = - 1 ; 14. a = 1, b = 2, c = 3, d =4, a < b? a: c < d? a: d ( ) A) 4 B) 3 C) 2 D) char ch = A, ( ) ch = ( ch > = A &&ch < = Z )? ( ch + 32) : ch A) A B) a C) Z D) z 16. ( ) { nt x = 12, y; y = x > 12? x + 10: x - 12; printf( y = % d \ n, y) ; A) y = 0 B) y = 22 C) y = 12 D) y = switch, case ( ) A) B) C) D) 18. k 3, ( ) switch( k) { ase 1: putchar( A ) ; case 2: putchar( B ) ; case 3: putchar( C ) ; case 4: putchar( D ) ; default: putchar( E ) ; A) CDE B) C C) ABC D) ABCD
72 C 1. : a > b, c = 0; c = 1 int a = 1, b = 2, c; if( a > b) ; c = 0; else c = 1 ; 2. : a > b, a, b int a, b, c; scanf( % d, % d, &a, &b) ; if( a > b) c = a; a = b; b = c; 1. ain( ) { nt a = 1, b = 2, c = 3 ; if( a > c) 2. ain( ) b = a; a = c; c = b; printf( a = % d b = % d c = % d \ n, a, b, c) ; { nt a = 3, b = 2, c = 1 ; 3. ain( ) if( a > b) a = b; if( b > c) b = c; else c = b; c = a; printf( a = % d b = % d c = % d \ n, a, b, c) ; { nt x = 2, y = 3, z; z = x; if( x > y) z = 1 ; else if( x = = y) z = 0 ; else z = - 1; printf( z = % d \n, z) ; 65
73 4. ain( ) { nt a = 10, b = 5, x; x = a < b? b: a; printf( x = % d \n, x) ; , 10 5%, %, 2., 3., very good!, good!, fair, 0 39 poor
74 C 4. switch,, 90 A, B, C, D, 60 E 5 ( 1. while( ), ( ), ) 2. while, while ( ) 3. for( 1; 2; 3 ), ( ) 0 4. continue ( ) 5. break ( ) 6., 0 { nt a, max = 0; scanf( % d, &a) ; wh le( { f( max < a) max = a; scanf( % d, &a) ; printf( % d, max) ; 7., 67
75 #include stdio. h { har c; int n = 0 ; c = getchar( ) ; while( { f( n + + ; c = getchar( ) ; 8. or( a = 0, b = 0; b! = 100&&a < 5; a + + ) scanf( % d, &b) ; scanf ( ), ( ) 9. 30, 90, for x = 1 ; x < = 29; x + + ) { y = 30 - x; if( printf( % d, % d, x, y) ; { nt i, t = 1, s = 0; fo ( i = 1; i < = 101; i + = 2) { s = s + t* i; printf( % d, s) ; , 7, { nt i, a; for i = 1; i < = 10 ; i + + ) { s anf( % d, &a) ; if( a% 7 = = 0) { printf( % d, a) ;
76 C 1. ( ) A) B) C) D) 2. : int i; for( i = 0; i < = 10 ; i + + ) ;, i = 0, ( ) A) for B) C) for D) 3. ( ) A) do... while B) do... while break C) do... while, while D) do... while, while 4., ( ) { nt n = 0 ; while( n < = 2) { + + ; printf( % 3d, n) ; A) 1 B) 1 2 C) D) ( ) int a, y; a = 10; y = 0 ; do { + = 2; y + = a; printf( a = % d y = % d \ n, a, y) ; if( y > 20) break; while( a = 14) ; A) a = 12 y = 12 a = 14 y = 16 a = 16 y = 20 a = 18 y = 24 B) a = 12 y = 12 a = 16 y = 28 C) a = 12 y = 12 D) a = 12 y = 12 a = 14 y = 26 a = 14 y = 44 69
77 6. ( ) for( i = 1; i < = 3; i + + ) ; printf( ok ) ; A) ok B) okok C) okokok D) 7. ( ) int s = 7; while( - - s) ; s = s - 2; printf( s = % d \n, s) ; A) s = 1 B) s = 2 C) s = 0 D) s = ( ) a = - 1; do { a = a* a; while(! a) ; A) 1 B) 2 C) D) 9., 1, - 3, 5, 8, - 2, ( ) { nt i, x; for( i = 1; i < = 5 ; i + + ) { canf( % d, &x) ; if( x < = 0 ) continue; printf( % d, x) ; A) B) C) D) s = ( ) A) for( i = 1; i < = 5; i + + ) { s = 1 ; C) s = 1; s = s* i; for( i = 1; i < = 5; i + + ) s = s* i; 11. ( ) B) for( i = 1; i < = 5; i + + ) { s = 0; D) s = 0; s = s* i; for( i = 1; i < = 5; i + + ) s = s* i;
78 C ( ) for( i = 1; i < = 100; i + + ) { canf( % d, &x) ; if( x < 0) continue; printf( % d, x) ; A) x < 0 B) x0 C) printf( ) D) ( ) { nt k = 10; while( k = 0) { = k - 1; printf( k = % d, k) ; A) 10 B) while C) D) ( ) { nt k = 2; wh le( k! = 0) { rintf( k = % d, k) ; k - - ; A) B) 0 C) 2 D) 1 14., < >, main ( ) { nt m, n; printf( Enter m, n: ) ; scanf( % d% d, &m, &n) ; while( m! = n) { hile( m > n) m - = n; while( n > m) n - = m; printf( m = % d \ n, m) ; 71
79 A) m = 3 B) m = 2 C) m = 1 D) m = 0 15., ( ) A) int i = 100 while ( 1) {i = i% ; if( i > 100) break; B) for( ; ; ) ; C) int k =1000; do{ + + k while ( k > =1000) ; 16. for( i = 1; i + + < 4; ) ;, i ( ) D) int s =36 A) 3 B) 4 C) 5 D) 17. a b int, b ( ) a = 1; b = 10; do {b - = a; a + + ; while( b < 0) ; A) 9 B) - 2 C) - 1 D) 8 while( s) ; - - s; 18., 3, 0, ( 1),( 2) { ong int num; scanf( % ld, &num) ; do if( ( 1) ) printf( % ld, num) ; scanf( % ld, &num) ; while( ( 2 ) ) ; ( 1 ) ) num% 100 /10 = = 3 B) num /100 % 10 = = 3 C) num% 10 /10 = = 3 D) num/10% 10 = = 3 ( 2 ) A)! num B) num > 0 = = 0 C)! num = = 0 D)! num! = 0 1. s = s = 0 ; for( i = 1, i < = 5, i + + ) ; s = s + i;
80 C 2. s = s = 0 ; for( i = 1; i < = 5; i + + ) s = s* i; 1. ain( ) { nt x = 1, y = 1, i = 0; do 2. ain( ) { = x + y; y = x + y; i + + ; printf ( x = % d while( i < = 3) ; { nt x = 2, y = 10, i; 3. ain( ) for( i = x; i < = y; i + + ) ; printf( i = % d \ n, i) ; { nt x, y; 4. ain( ) y = % d \ n, x, y) ; fo ( y = 1, x = 1; y < = 50; y + + ) { f( x > = 10) break; if( x% 2 = = 1) { x + = 5; continue; x - = 3; printf( x = % d, y = % d \n, x, y) ; { nt j; fo ( j = 10; j > 3 ; j - - ) { f( j% 3) j - - ; 5. ain( ) j - = 2; printf( % 3d, j) ; 73
81 { nt x = 1, y = 0; switch( x) { ase : switch( y) 6. ain( ) { ase 0: printf( * * 1* * \ n ) ; break; case 1: printf( * * 2* * \ n ) ; break; case 2: printf( * * 3* * \n ) ; { nt x = 0, y = 0; 7. ain( ) while( x < 15) y + +, x + = + + y; printf( % d, % d, y, x) ; { nt i, sum = 0; 8. ain( ) for( i = 0 ; i < 3; i + + ) printf( % d % d \ n, i, sum + = i) ; { i t i; 9. ain( ) fo ( i = 1; i < = 5; i + + ) { f( i% 2 ) printf( * ) ; else continue; printf( # ) ; printf( \ n ) ; { i t i; fo ( i = 1; i < = 5; i + + ) sw tch( i% 2 ) { ase 0: i + + ; printf( # ) ; break; case 1: i + = 2 ; printf( * ) ; default: printf( \ n ) ;
82 C 1. n, 2. x, 0,, 3., : 50, 1. 5 ; 50, 0. 6, 5 150, , 75
83 6 1. int a[ 10] ;, a ( ), ( ) 2. int x[ 10] ;, x ( ), ( ), ( ), x ( ) 3. str Lei( ) 4. int a[ ] = {0, 1, 2, 3, 4, 5 ;, ( ) 5.,? ( ) 1. int a[ 10 ] ;, ( ) A) a( 9 ) B) a[ 9 ] C) a[ 10] D) a[ 3. 5] 2. ( ) A) int x[ 5] = {0, 1, 2, 3, 4, 5 ; B) int x[ ] = {0, 1, 2, 3, 4, 5 ; C) int x[ 5 ] = {0. 0 ; D) int x[ ] = ( 0, 1, 2, 3, 4, 5) ; 3. ( ) A) int x( 10) ; B) int x[ 5] = {0, 1, 2, 3, 4, 5 ; C) int n = 10; x[ n] ; D) int x[ ] = {0, 1, 2, 3, 4, 5 ; 4. a ( ) A) int a( 10) B) int n = 10, a[ n] ; C) int n; D) #define SIZE 10 scanf( % d, &n) ; int a[ SIZE] ; int a[ n] ; 5. ( ) A) int a[ 3] [ ] ; B) float a( 3, 4) ; C) double a[ 1] [ 4 ] ; D) float a( 3) ( 4) ; 6. : int a[ 3] [ 4] ;, ( ) A) a[ 2 ] [ 4 ] B) a[ 1, 3] C) a[ 1 + 1] [ 0] D) a( 2) ( 1) 7. ( ) A) int a[ 2] [ ] = { {1, 0, 1, {5, 2, 3 ;
84 C ( ) B) int a[ ] [ 3] = { {1, 2, 3, {4, 5, 6 ; C) int a[ 2 ] [ 4] = { {1, 2, 3, {4, 5, { 6 ; D) int a[ ] [ 3] = { {1, 0, 1 {, {1, 1 ; 8. ( ) A) ain( ) B) { loat a[ 10] = {0. 0 ; C) int i; D) for( i = 0; i < 3; i + + ) scanf( % d, &a[ i] ) ; E) for( i = 1; i < 10; i + + ) a[ 0] = a[ 0 ] + a[ i] ; F) printf( % f\ n, a[ 0 ] ) ; 9. str1, str2 ( ) A) if( str1 = = str2) ) if( if( str1 = str2 ) ) C) if( strcpy( str1, str2) ) D) if( strcmp( str1, str2 ) ) 10. : char array [ ] = China ;, array A) 4 ) 5 ) 6 ) ( ) { nt a[ 6], i; f r( i = 1; i < 6; i + + ) { [ i] = 9* ( i * ( i > 3) ) % 5; printf( % 2d, a[ i] ) ; A) B) C) D) s, ( ) A) char s[ 5] = { abc ; B) char s[ 5] = { a, b, c ; C) char s[ 5 ] = ; D) char s[ 5] = abcdef ; 13. ( ) char c[ 5] = { a, b, \0, c, \0 ; printf( % s, c) ; A) a b B) ab C) ab c D) abc 14. : char a[ ] = ABCDEF ; 77
85 char b[ ] = { ( ) A, B, C, D, E, F ; A) a b B) a b C) a b D) a b 15. : int i; int x[ 3 ] [ 3] = {1, 2, 3, 4, 5, 6, 7, 8, 9 ; ( ) for( i = 0; i < 3 ; i + + ) printf( % 2d, x[ i] [ 2 - i] ) ; A) B) C) D) , k ( ) int k = 3, s[ 2] ; s[ 0] = k; k = s[ 1] * 10 ; A) B) 33 C) 30 D) , Hello! b ( ) A) char b[ 10] = { H, e, l, l, o,! ; B) char b[ 10] ; b = Hello! ; C) char b[ 10] ; strcpy( b, Hello! ) ; D) char b[ 10] = Hello! ; 18. ( ) char a[ 7] = abcdef ; char b[ 4] = ABC ; strcpy( a, b) ; printf( % c, a[ 5] ) ; A) ( ) B) \0 C) e D) f 19. s1 s2, ( ) A) if( s1 > s2) B) if( strcmp( s1 > s2) ) C) if( strcmp( s2, s1) > 0 ) D) if( strcmp( s1, s2 ) > 0) 20. ( ) A) B) C) = D) 21. ( ) { char ch[ 7 ] = { 12ab56 ; int i, s = 0;
86 for( = 0; ch[ i] > = 0 &&ch[ i] < = 9 ; i + = 2) s = 10* s + ch[ i] - 0 ; printf( % d \ n, s) ; C A) 1 B) 1256 C) 12ab56 D) , int n; int a[ n] ; 2. a : { nt a[ 10], i; for( i = 1 ; i < 10; i + + ) scanf( % d, &a[ i] ) ; 1. ain( ) { nt a[ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, s = 0, i; 2. ain( ) for( i = 0 ; i < 10; i + + ) if( a[ i] % 2 = = 0) s = s + a[ i] ; printf( s = % d, s) ; { nt a[ ] = {1, 3, 5, 2, 7 ; 3. ain( ) int b[ ] = { 5, 3, 9, 4, 6 ; int c[ 5], i; f r( i = 0; i < 5; i + + ) c[ i] = a[ i] * b[ i] ; for( i = 0 ; i < 5; i + + ) printf( % d, c[ i] ) ; { nt i, k, a[ 10 ], p[ 3] : k = 5; for ( i = 0 ; i < 10; i + + ) a[ i] = i; 79
87 4. ain( ) { for ( i = 0 ; i < 3; i + + ) p[ i] = a[ i* ( i + 1) ] ; for ( i = 0 ; i < 3; i + + ) k = p[ i] * 2; printf( % d \n, k) ; int y = 18, i = 0, j, a[ 8 ] ; do { a[ i] = y% 2; i + + ; y = y /2; while( y > = 1) ; for( j = i - 1; j > = 0; j - - ) printf( % d, a[ j] ) ; printf( \ n ) , 2. n,,,,
88 C 3. n, m,,,, 7 1. ( ) ( ), ( ) ( ) 2., ( ) 3., ( ) 1. ( ) A) B) C) D), 2. ( ) A), B) return C), D), 3. ( ) A) B) C) D) 81
89 4., ( ) A) B) C) D) 5. ( ) A) double fun( int x, int y) B) double fun( int x; int y) C) double fun( int x, int y) ; D) double fun( int x, y) ; 6. ( ) A) ouble fun( int x, int y) { z = x + y; return z; C) un( x, y) { nt x, y; double z; z = x + y; return z; 7. ( ) B) un( int x, y) { nt z; return z; D) ouble fun( int x, int y) { ouble z; A) C z = x + y; return z; B) C, C) C D) C 8. ( ) A) B) C) D) 9. : fun( a + b, ( x, y), fun( n + k, d, ( a, b) ) ) ;, ( ) A) 3 B) 4 C) 5 D) ( ) #include stdio. h func( int a, int b) { nt c; c = a + b; return c;
90 C { nt x = 6, y = 7, z = 8, r; r = func( x - -, y + +, x + y), z) ; printf( % d \ n, r) ; A) 11 B) 20 C) 21 D) ( ) fun3( int x) { tatic int a = 3 ; a + = x; return( a) ; { nt k = 2, m = 1, n; n = fun3( k) ; n = fun3( m) ; printf( % d \ n, n) ; A) 3 B) 4 C) 6 D) static char str[ ] = Beijing ;, printf( % d \ n, strlen ( strcpy( str, China ) ) ) ; ( ) A) 5 B) 7 C) 12 D) , fun ( ) { in a[ 50], n; fun(, &a[ 9] ) ; A) void fun( int m, int x[ ] ) B) void fun( int s, int h[ 41 ] ) C) void fun( int p, int * s) D) void fun( int n, int a) 14. ( ) void func1( int i) ; void func2( int i) ; char st[ ] = hello, friend! ; 83
91 void func1( int i) { p intf( % c, st[ i] ) ; if( i < 3) { i + = 2; func2 ( i) ; void func2( int i) { rintf( % c, st[ i] ) ; if( i < 3 ) { i + = 2; func1( i) ; { nt i = 0; func1( i) ; printf( \ n ) ; A) hello B) hel C) hlo D) hlm 1. oid num( ) { xtern int x, y; int a = 15, b = 10 ; x = a - b; y = a + b; int x, y; { nt a = 7, b = 5; x = a + b; y = a - b; num( ) ; printf( % d, % d \ n, x, y) ; 2. unc( int a, int b) { tatic int m = 0, i = 2; i + = m + 1; m = i + a + b; return m;
92 C { nt k = 4, m = 1, p; p = func( k, m) ; printf( % d,, p) ; p = func( k. m) ; printf( % d \ n, p) ; 8 1. : #define N 3 #define Y( n) ( ( N + 1) * n) : z = 2* ( N + Y( ) ) ;, z ( ) A) B) 42 C) 48 D) ( ) #include stdio. h #define SUB( X, Y) ( X) * Y { nt a = 3, b = 4; printf( % d, SUB( a + +, b + + ) ) ; A) 12 B) 15 C) 16 D) ( ) #include stdio. h #define MIN( x, y) ( x) < ( y)? ( x) : ( y) { nt i, j, k; i = 10; j = 15; k = 10 * MIN( i, j) ; printf( % d \n, k) ; A) 15 B) 100 C) 10 D) , a ( ) #define SQR( X) X* X { nt a = 10, k = 2, m = 1; 85
93 a / = SQR( k + m) / SQR( k + m) ; printf( % d \n, a) ; A) 10 B) 1 C) 9 D) 0 5. ( ) #define MA( x) x* ( x - 1) { nt a = 1, b = 2; printf( % d \n, MA( 1 + a + b) ) ; A) 6 B) 8 C) 10 D) ( ) int fun( int x, int y, int * cp, int * dp) { cp = x + y; * dp = x - y; { nt a, b, c, d; a = 30; b = 50; fun( a, b, &c, &d) ; printf( % d, % d \ n, c, d) ; A) 50, 30 B) 30, 50 C) 80, - 20 D) 80, : int f( char * s) { har * p = s; while( * p! = \0 ) p + + ; return( p - s) ;, ( ) printf( % d \ n, f( goodbey! ) ) ;
94 C A) 3 B) 6 C) 8 D) 0 3. ( ) void prtv( int * x) { printf( % d \n, + + * x) ; { nt a = 25 ; prtv( &a) ; A) 23 B) 24 C) 25 D) ( ) int funl( char * x) { har * y = x; while( * y + + ) ; return( y - x - 1 ) ; A) B) C) x y D) x y 5. ( ) sss( s, t) char * s, * t; { hile( ( * s) &&( * t) &&( * t + + = = * s + + ) ) ; return( * ( - - s) - * ( - - t) ) ; A) B) C) s t D) s t 6. ( ) { nt i, x[ 3] [ 3] = {9, 8, 7, 6, 5, 4, 3, 2, 1, * p = &x[ 1] [ 1] ; for( i = 0 ; i < 4; i + = 2) printf( % 3d, * ( p + i) ) ; A) 5 2 B) 5 1 C) 5 3 D) : long int * p, a;, scanf ( ) 87
95 A) p = &a; scanf( % ld, p) ; B) = &a; scanf( % ld, p) ; C) scanf( % ld, p = &a) ; D) scanf( % ld, &a) ; 8. : char * st = how are you ;, ( ) A) har a[ 11 ], * p; strcpy( p = a + 1, &st[ 4] ) ; C) har a[ 11] ; strcpy( a, st) ; 9., ( ) { har * s = abcde ; s + = 2; printf( % ld \n, s) ; B) har a[ 11] ; strcpy( + + a, st) ; D) har a[ ], * p; strcpy( p = &a[ 1 ], st + 2) ; A) cde ) c ASCII ) c ) 10. : char str[ ] = ABCD, * p = str; printf( % d \ n, * ( p + 4) ) ; ( ) A) 68 B) 0 C) D D) 11. p1 p2 int, k int, ( ) A) k = * p1 + * p2; B) p2 = * k; C) p1 = p2; D) k = * p1 * ( * p2 ) ; 12. : int i, j = 7, * p = &i;, i = j; ( ) A) i = * p; ) * p = * &j; ) i = &j; ) i = * * p; 13. ( ) #include stdio. h #include string. h { har * p1 = abc, * p2 = ABC, str[ 50] = xyz ; strcpy( str + 2, strcat( p1, p2) ) ; printf( % s \ n, str) ;
96 C A) xyzabcabc B) zabcabc C) yzabcabc D) xyabcabc 14. ( ) { har a[ ] = programming, b[ ] = language ; char * p1, * p2; int i; p1 = a; p2 = b; fo ( i = 0; i < 7 ; i + + ) if * ( p1 + i) = = * ( p2 + i) ) printf( % c, * ( p1 + i) ) ; A) gm B) rg C ) or D) ga 15. x, pb, ( ) A) pb = &x B) pb = x; C) * pb = &x; D) * pb = * x 16. s ( ) char * s = \ \ Name \ \ Address \ n ; A) 19 B) 15 C) 18 D) 17. : int arr[ ] = {6, 7, 8, 9, 10 ; int * ptr; ( ) ptr = arr; * ( ptr + 2) + = 2; printf ( % d, % d \n, * ptr, * ( ptr + 2) ) ; A) 8, 10 B) 6, 8 C) 7, 9 D) 6, int( * ptr) [ m] ;, ptr ( ) A) m B) m C) m D) m, 19., ( ) A) char st[ 4] [ 5] = { ABCDE ; B) char s[ 5 ] = { A, B, C, D, E ; 89
97 C) char * s; s = ABCDE ; D) char * s; scanf( % s, s) ; 20. ( ) void func( int * a, int b[ ] ) { b[ 0] = * a + 6 ; { t a, b[ 5] ; a = 0; b[ 0] = 3; func( &a, b) ; printf( % d \ n, b[ 0] ) ; A) 6 B) 7 C) 8 D) ( ) int b = 2 ; int func( int * a) { + = * a; return( b) ; { nt a = 2, res = 2; res + = func( &a) ; printf( % d \ n, res) ; A) 4 B) 6 C) 8 D) ( ) { nt a[ 3] [ 3 ], * p, i; p = &a[ 0] [ 0] ; for( i = 0; i < 9; i + + ) p[ i] = i + 1; printf( % d \ n, a[ 1] [ 2] ) ; A) 3 B) 6 C) 9 D) 23. ( ) A) int * p; B) int * s, k; scanf( % f, p) ; * s = 100;
98 C C) int * s, k; D) int * s, k; char * p, c; char * p, c; s = &k; p = &c; s = &k; p = &c; * p = a ; s = p; * s = 500; 24. ( ) { har arr[ 2] [ 4] ; strcpy( arr, you ) ; strcpy( arr[ 1 ], me ) ; arr[ 0] [ 3] = & ; printf( % s \ n, arr) ; A) you&me B) you C) me D) arr ( ) #include stdio. h { nion { nt k; char i[ 2] ; * s, a; s = &a; s - > i[ 0] = 0x39 ; s - > i[ 1] = 0x38; printf( % x \n, s - > k) ; A) 3839 B) 3938 C) D) : typedef nion 91
99 struct { ong i; ate int k[ 5] ; char c; DATE; { nt cat; DATE max; DATE cow; double dog; too; ( ) printf ( % d, sizeof( struct date) + sizeof( max) ) ; A) 26 B) 30 C) 18 D) 8 3. ( ) A) #define printf C B) #define C, printf C) printf C, #define D) #define printf C 4. : ( struc st { nt n; struct st * next; ; static struct st a[ 3] = {5, &a[ 1 ], 7, &a[ 2 ], 9, \0, * p; p = &a[ 0] ; ) 6 A) p > n B) p - > n + + C) (* p). n + + D) + + p - > n 5. ( ) struct abc { int a, b, c; ; { truct abc s[ 2] = { {1, 2, 3, {4, 5, 6 ; int t; t = s[ 0]. a + s[ 1]. b; printf( % d \n, t) ; A) 5 B) 6 C) 7 D) 8 6., a ( )
100 union UVB { har st[ 4] ; ; int i; long l; struct A { nt c; a; union UVB u; A) 4 B) 5 C) 6 D) 8 7. int b = 2;, ( b > > 2) /( b > > 1) ( ) A) 0 B) 2 C) 4 D) 8 8. printf( % d \ n, 12&012) ; ( ) A) 12 B) 8 C) 6 D) 012 C 9. C, ( ) A) fprintf B) fread C) fwrite D) fputc C, ( ) A) \084 B) \ x43 C) ab D) \0 2. x y double, x = 1, y = x* 3 /2 ( ) A) 1 B) 2 C) 2. 0 D) , ( ) A) int a[ ] = string ; B) int a[ 5] = {0, 1, 2, 3, 4, 5 ; C) vhst s = string ; D) int a[ ] = {0, 1, 2, 3, 4, 5 ; 4. a, 15 < a < 100 ( ) A) a > 100 a < 15 B) a < 100&&a > 15 C) a > = 100 a < = 15 D) a < = 100&&a > = t double, t = 1, t + 5 ( ) A) 1 B) 6. 0 C) 2. 0 D) : 93
101 char s[ 10] ; s = abcd ; printf( % s \ n, s) ; ( ) ( ) A) abcd B) a C) abcd abcd D) 7. : int * * pp, * p, a = 10, b = 20 ; pp = &p; p = &a; p = &b; printf( % d \ n, * p, * * pp) ; ( ) A) 10, 20 B) 10, 10 C) 20, 10 D) 20, : int u = 010, v = 0 x10, w = 10; printf( % d, % d, % d \ n, u, v, w) ; ( ) A) 8, 16, 10 B) 10, 10, 10 C) 8, 8, 10 D) 8, 10, : char c1 = b, c2 = e ; printf( % d, % c \ n, c2 - c1, c2 - a + A ) ; ( ) A) 2, M B) 3, E C) 2, E D), 10. : char s[ 20] = programming, * ps = s; o ( ) A) ps2 B) s[ 2 ] C) ps[ 2 ] D) ps + 2, * ps 11. int i, j;, ( ) for( i = 5; i > 0; i - - ) for( j = 0; j < 4; j + + ) { A) 20 B) 25 C) 24 D) : char * s1 = 12345, * s2 = 1234 ; printf( % d \ n, strlen( strcpy( s1, s2) ) ) ; ( ) A) 4 B) 5 C) 9 D) : int a[ 10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, * p = a;
102 C a ( ) A) * p B) a[ 10] C) * a D) a[ p - a] 14. ( ) {c ar * s = 0121 ; int k = 0, a = 0, b = 0; do { + + ; if( k% 2 = = 0) { a = a + s[ k] - b = b + s[ k] - while( s[ k]! = \0 ) ; 0 ; continue; 0 ; a = a + s[ k] - 0 ; printf( k = % d a = % d b = % d \ n, k, a, b) ; A) k = 3 a = 2 b = 3 B) k = 3 a = 4 b = 2 C) k = 2 a = 4 b = 2 D) k = 2 a = 2 b = ( ) { nsigned a = ; printf( a = % d \ n, a) ; A) a = B) a = C) a = D) a = : float x; int a, b; switch ( ) A) switch( x) B) switch( x) { case 1. 0: printf( * \ n ) ; { case 1, 2: printf( * \n ) ; case 2. 0: printf( * * \ n ) ; case 3 : printf( * * \ n ) ; C) switch ( ab) D) switch ( ab) ; { case 1: printf( \ n ) ; { case 1: printf( * \n ) ; case 2: printf( * * \n ) ; case 2 : printf( * * \ n ) ; 17. : int x, y; char a, b, c; ( ) : 2 A B C x 1, y 2, a A, b B, c C ( ) 95
103 A) canf( x = % d y = % d, &x, &y) ; a = getchar( ) ; b = getchar( ) ; c = getchar( ) ; B) scanf( % d % d, &x, &y) ; a = getchar( ) ; b = getchar( ) ; c = getchar( ) ; C) scanf( % d% d% c% c% c, &x, &y, &a, &b, &c) ; D) scanf( % d% d% c% c% c% c% c% c, &x, &y, &a, &a, &b, &b, &c, &c) ; 18. ( ) #include stdio. h {c ar w[ ] [ 10] = { ABCD, EFGH, IJKL, MNOP ; int k; for ( k = 1; k < 3; k + + ) printf( % s \ n, &w[ k] [ k] ) ; A) ABCD B) ABCD C) EFG D) FGH FGH EFG JK KL KL IJ O M 19. : int a[ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, * p = a; 3 ( ) A) p = 2, * ( p) B) p = 2, * p C) p + = 3, * kp D) p + = 2, * p 20., x ( ) a = b = c = 0 ; x = 35; if! a) x - - ; e se if( b) x = 2 ; e se if( c) x = 3 ; else x = 4; A) 34 ) 4 ) 35 ) 3 21., ( ) A) < = B) = C) % D) && 22. : int w[ 2] [ 3], (* pw) [ 3] ; pw = w; w ( ) A) * ( w[ 0] 2) B) * ( pw1) [ 2 ] C) pw[ 0] [ 0] D) * ( pw[ 1] [ 2] )
104 C 23. : char str[ ] = ab \ n \012 \ \ \ ; printf( % d, strlen( str) ) ; ( ) A) 3 B) 4 C) 6 D) : strcat( strcpy( str1, str2), str3 ) ( ) A) str1 str2, str3 B) str1 str2, str3 C) str2 str1, str3 str1 D) str2 str1, str1 str3 25. C, ( ) A) C,, B) C, C), D) C 26. ( ) A) C,,, B) C, C) C, D) C, register 27. ( ) #include stdio. h subl( char a, char b) { char c; c = a; a = b; b = c; sub2 ( char* a, char b) { char c; c = * a; * a = b; b = c; sub3 ( char* a, char* b) { char c; c = * a; * a = * b; * b = c; { har a, b; a = A ; b = B ; sub3( &a, &b) ; putchar( a) ; putchar( b) ; a = A ; b = B ; sub2( &a, b) ; putchar( a) ; putchar( b) ; a = A ; b = B ; sub1( a, b) ; putchar( a) ; putchar( b) ; A) BABBAB B) ABBBBA C) BABABA D) BAABBA 28. : 97
105 struct sk {int a; float b; data, * p; p = &data;, data a ( ) A) ( * p). data. a B) ( * p). a C) p - > data. a D) p. data. a 29. ( ) A) enum a = {one, two, three ; B) enum a { one, two, three ; C) enum a = { one, two, three ; D) enum a { one, two, three ; 1. a C ( bc ) 2. a = 10, b = - 10,! a + b ( ) 3.,, ( ) 4. fun void, : #define M 50 { i t a[ M] ; fun( a) ; fun, : ( ), ( ), ( ) ( : q, ) 5. fun s : 6354abc, ( ) long fun( char s[ ] ) { ong n; int sign; for( ; isspace( * s) ; s + + ) ; sign = ( * s = = - )? - 11 ;
106 C if( * s = = - ) s + + ; for( n = 0 ; isdigit( * s) ; s + + ) n = 10* n + ( * s - 0 ) ; return ( sign* n) ; 6. w xw, n,, void fun ( char * w, char x, int * n) { nt i, p; p = 0; w[ * n] = x; wh le ( x > w[ p] ) ( ; for( i = * n; i > p; i - - ) w[ i] = ( ; w[ p] = x; * n + + ; 7. fun1 : fun1 ( &a, &b, &c) ;, a, b, c, a vo d fun2 ( int * x, int * y) { nt t; t = * x; * x = * y; * y = t; v id fun1 ( int * pa, int * pb, int * pc) { f( * pa < * pb) fun2( ; if( * pa < * pc) fun2 ( ; if( * pb < * pc) fun2( ; 1. ( ) A) C B) C) 12 D) 99
107 2. ( ) A) 5E2. 0 B) E - 3 C). 2E0 D) 1. 3E 3. ( ) A) long B) 2Test C) 3Dmax D) A. dat 4. A ASCII 65, a ASCII 97, \101 ( ) A) A B) a C) e D) 5. ( ) A) n = ( i = 2, + + i) ; B) j + + ; C) + + ( i + 1) ; D) x = j > 0 ; 6. a b double, a = 5. 5, b = 2. 5, ( int) a + b / b ( ) A) B) 6 C) D) i, j, k int, 1, 2, 3 < >, i 1, j 2, k 3, ( ) A) scanf( % 2d% 2d% 2d, &i, &j, &k) ; B) scanf( % d % d % d, &i, &j, &k) ; C) scanf( % d, % d, % d, &i, &j, &k) ; D) scanf( i = % d, j = % d, k = % d, &i, &j, &k) ; 8. 3xn C ( ) 2 x - 1 A) 3* x^n / ( 2* x - 1) B) 3* x* * n /( 2* x - 1) C) 3* pow( x, n) * ( 1 / ( 2* x - 1 ) ) D) 3* pow( n, x) / ( 2* x - 1) 9. : long x = L;, x ( ) A) printf( x = % d \ n, x) ; B) printf( x = % ld \n, x) ; C) printf( x = % 8dL \n, x) ; D) printf( x = % LD \n, x) ; 10. : { nt k = 2, i = 2, m; m = ( k + = i* = k) ; printf( % d, % d \ n, m, i) ; ( )
108 C A) 8, 6 B) 8, 3 C) 6, 4 D) 7, : int x = 3, y = 4, z = 5;,! ( x + y) + z - 1 &&y + z /2 ( ) A) 6 B) 0 C) 2 D) y = 1, x > 0, 0, x = 0, - 1, x < 0 x y ( ) A) if( x > 0) y = 1; else if( x = = 0) y = 0 ; else y = - 1; B) y = 0; if( x > 0) y = 1; else if( x < 0 ) y = - 1; C) y = 0; if( x > = 0) if( x > 0 ) y = 1; else y = - 1; D) if( x > = 0) if( x > 0 ) y = 1; else y = 0 ; else y = - 1; 13., k = n + + ( ) A) k = n, n = n + 1 B) n = n + 1, k = n C) k = + + n D) k + = n : 10 4,, : ain( ) { nt n, k; float score, sum, ave; sum = 0. 0; for( n = 1; n < = 10; n + + ) { o ( k = 1; k < = 4; k + + ) { scanf( % f, &score) ; sum + = score; ave = sum /4. 0 ; printf( NO% d: % f\ n, n, ave) ;, ( ) A) sum = 0. 0; B) sum + = score; C) ave = sum/4. 0; D) printf( NO% d: % f\ n, n, ave) ; 15. : int n = 0, p; 101
109 do { scanf( % d, &p) ; n + + ; while( p! = &&n < 3) ; do... while ( ) A) p n 3 B) p n 3 C) p n 3 D) p n : { nt a = 15, b = 21, m = 0; sw tch( a% 3) { ase 0: m + + ; break; case 1 switch( b% 2) { efault: m + + ; printf( % d \ n, m) ; ( ) ( ) case 0: m + + ; break; A) 1 B) 2 C) 3 D) C,, ( ) A) void B) int C) float D) double 18. : int n = 2, * p = &n, * q = p;, A) p = q; B) * p = * q; C) n = * q; D) p = n; 19. : float fun( int x, int y) { return( x + y) ; { nt a = 2, b = 5, c = 8; printf( % 3. 0f \n, fun( ( int) fun( a + c, b), a - c) ) ; ( ) A) 8 B) 9 C) 7 D) :
110 void fun( char * c, int d) { c = * c + 1 ; d = d + 1; printf( % c, % c,, * c, d) ; { har a = A, b = a ; fun( &b, a) ; printf( % c, % c \ n, a, b) ; ( ) A) B, a, B, a B) a, B, a, B C) A, b, A, b D) b, B, A, b C 13 : 1. sort a void sort( int a[ ], int n) { nt i, j, t; for( i = 0; i < n - 1; i + + ) for( j = i + 1 ; j < n; j + + ) if( a[ i] < a[ j] ) { t = a[ i] ; a[ i] = a[ j] ; a[ j] = t; { i t aa[ 10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, i; sort( &aa[ 3], 5) ; for( i = 0 ; i < 10; i + + ) printf( % d,, aa[ i] ) ; printf( \ n ) ; ( ) A) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, B) 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, C) 1, 2, 3, 8, 7, 6, 5, 4, 9, 10, D) 1, 2, 10, 9, 8, 7, 6, 5, 4, 3, 2. : int f( int n) 103
111 { f ( n = = 1 ) return 1; else return f( n - 1) + 1; { nt i, j = 0 ; for( i = 1 ; i < 3; i + + ) j + = f( i) ; printf( % d \n, j) ; ( ) A) 4 B) 3 C) 2 D) 1 3. : { har a[ ] = { a, b, c, d, e, f, g, h, \0 ; int i, j; i = sizeof( a) ; j = strlen( a) ; printf( % d, % d \ n, i, j) ; ( ) A) 9, 9 B) 8, 9 C) 1, 8 D) 9, 8 4. reverse a : void reverse( int a[ ], int n) { nt i, t; for( i = 0 ; i < n /2; i + + ) { t = a[ i] ; a[ i] = a[ n i] ; a[ n i] = t; { nt b[ 10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ; int i, s = 0; reverse( b, 8) ; for( i = 6 ; i < 10; i + + ) s + = b[ i] ; printf( % d \n, s) ; ( ) A) 22 B) 10 C) 34 D) :
112 C { nt aa[ 4 ] [ 4] = { {1, 2, 3, 4, {5, 6, 7, 8, {3, 9, 10, 2, {4, 2, 9, 6 ; int i, s = 0; for( i = 0 ; i < 4; i + + ) s + = aa[ i] [ 1 ] ; printf( % d \n, s) ; ( ) A) 11 B) 19 C) 13 D) : #include string. h { har * p = abcde \0fghjik \0 ; printf( % d \n, strlen( p) ) ; ( ) A) 12 B) 15 C) 6 D) 5 7. type1. h : #define N 5 #define M1 N* 3 : #include type1. h #define M2 N* 2 { nt i; i = M1 + M2; printf( % d \ n, i) ; ( ) A) 10 B) 20 C) 25 D) : #include stdio. h { ILE * fp; int i = 20, j = 30, k, n; fp = fopen( d1. dat, w ) ; fprintf( fp, % d \ n, i) ; fprintf( fp, % d \n, j) ; 105
113 fclose( fp) ; fp = fopen( d1. dat, r ) ; fscanf( fp, % d% d, &k, &n) ; printf( % d% d \n, k, n) ; fclose( fp) ; ( ) : A) B) C) D) ( ) A), B), fclose C) fread, D) FILE 10. : #include string. h main( int argc, char * argv[ ] ) { nt i, len = 0; for( i = 1; i < argc; i + + ) len + = strlen( argv[ i] ) ; printf( % d \ n, len) ; ex1. exe ex1 abcd efg 10 < > ( ) A) 22 B) 17 C) 12 D) : int fa( int x) { return x* x; int fb( int x) { return x* x* x; int f( int ( * f1) ( ), int ( * f2) ( ), int x) { return f2 ( x) - f1( x) ; { nt i;
114 C i = f( fa, fb, 2) ; printf( % d \ n, i) ; ( ) A) - 4 B) 1 C) 4 D) : int a = 3 ; { nt s = 0 ; { int a = 5; s + = a + + ; s + = a + + ; printf( % d \ n, s) ; ( ) A) 8 B) 10 C) 7 D) : void ss( char * s, char t) { hile( * s) { f( * s = = t) * s = t - a + A ; s + + ; { har str1[ 100] = abcddfefdbd, c = d ; ss( str1, c) ; printf( % s \n, str1) ; ( ) A) ABCDDEFEDBD B) abcddfefdbd C) abcaafefaba D) Abcddfefdbd 14. : struct STU { char num[ 10] ; float score[ 3 ] ; { struct STU s[ 3] = { { 20021, 90, 95, 85, { 20022, 95, 80, 75, { 20023, 100, 95, 90, * p = s; int i; float sum = 0 ; for( i = 0 ; i < 3; i + + ) 107
115 sum = sum + p - > score[ i] ; printf( % 6. 2f\ n, sum) ; ( ) A) B) C) D) : struct sk { nt a; float b; data; int * p; p data a, ( ) A) p = &a; B) p = data. a; C) p = &data. a; D) * p = data. a 16. : #include stdlib. h struct NODE {int num; struct NODE * next; { truct NODE * p, * q, * r; p = ( struct NODE * ) malloc( sizeof( struct NODE) ) ; q = ( struct NODE * ) malloc( sizeof( struct NODE) ) ; r = ( struct NODE * ) malloc( sizeof( struct NODE) ) ; p - > num = 10 ; q - > num = 20; r - > num = 30 ; p - > next = q; q - > next = r; printf( % d \ n, p - > num + q - > next - > num) ; ( ) A) 10 B) 20 C) 30 D) : typedef int * INTEGER INTEGER p, * q; ( ) A) p int B) p int
116 C C) q int D) INTEGER int 18. : { nsigned char a, b, c; a = 0x3; b = a 0x8; c = b < < 1; printf( % d% d \n, b, c) ; ( ) A) B) C) D) : #include stdlib. h { har * p, * q; p = ( char * ) malloc( sizeof( char) * 20) ; q = p; scanf( % s% s, p, q) ; printf( % s % s\ n, p, q) ; abc def < >, ( ) A) def def B) abc def C) abc d D) d d 20. f n : #include string. h void f( char p[ ] [ 10 ], int n) { har t[ 20] ; int i, j; for( i = 0; i < n - 1; i + + ) for ( j = i + 1; j < n; j + + ) if( strcmp( p[ i], p[ j] ) < 0) { strcpy( t, p[ i] ) ; strcpy( p[ i], p[ j] ) ; strcpy( p[ j], t) ; { har p[ ] [ 10] = { abc, aabdfg, abbd, dcdbe, cd ; int i; f( p, 5) ; printf( % d \ n, strlen( p[ 0] ) ) ; ( ) A) 6 B) 4 C) 5 D) 3 109
117 1. { nt x = 10, y = 20, t = 0; if( x = = y) t = x; x = y; y = t; pr ntf( % d, % d \ n, x, y) ; 2. { nt x = 15 ; while( x > 10&&x < 50) { + + ; if( x /3) { x + + ; break; else continue; printf( % d \n, x) ; 3. : #include stdio. h { har c; while( ( c = getchar( ) )! =? ) putchar( - - c) ;, Y? N? 4. void fun( int x, int y) { = x + y; y = x - y; x = x - y; printf( % d, % d,, x, y) ; { nt x = 2, y = 3; fun( x, y) ; printf( % d, % d \ n, x, y) ; < >,
118 C 5. s, s = /2! + 1 /3! / n!, double fun( int n) { ouble s = 0. 0, fac = 1. 0; int i; for( i = 1 ; i < = n; i + + ) { ac = fac ( ; s = s + fac; return s; 6. #define N 10 #define s( x) x* x #define f( x) ( x* x) { nt i1, i2; i1 = 1000 / s( N) ; i2 = 1000 / f( N) ; printf( % d % d \ n, i1, i2) ; 7. void swap( int * a, int * b) { nt * t; t = a; a = b; b = t; { nt x = 3, y = 5, * p = &x, * q = &y; swap( p, q) ; printf( % d, % d \ n, * p, * q) ; 8. typedef union student { har name[ 10] ; long sno; char sex; float score[ 4] ; 111
119 STU; { TU a[ 5] ; printf( % d \n, sizeof( a) ) ; 9. fp, d1. dat,, : fp = fopen( ; 10. : int n, * k = &n;, k n, scanf( % d, ; printf( % d \ n, ; 11. fun : a N N, N, #include stdio. h #define N 100 int fun( int(* a) [ N] ) { nt row, col, max, min; for( row = 0; row < N; row + + ) { or( max = a[ row] [ 0 ], col = 1; col < N; col + + ) if( max = a[ row] [ col] ; if( row = = 0 ) min = max; else if( min = max; return min; 12. sstrcmp( ) s t, 0; s t, 0; s t, 0 ( strcmp( ) ) #include stdio. h int sstrcmp( char * s, char * t) { hile( * s&&* t&&* s = = { s + + ; t + + ; return ( ;
120 C ( ) A) C B) C C) C D) C, 2. C ( ) A) B) if, switch, break C) for, while, do... while D) if, for, continue 3. C, ( ) A) B) C) D) 4. ( ) A) C, B) C, C) C, D) C, 5. C ( ) A) ( ) B), C), D), 6. ( n ) : int m = 32767, n = ; printf( % d, % o \ n, m, n) ; 113
121 ( ) A) 32767, B) 32767, C) 32767, D) 32767, ( ) A) B) char int, float C) int, double float D) char int float 8. : int m = 0xabc, n = 0xabc; m - = n; printf( % x \ n, m) ; ( ) A) 0X0 B) 0x0 C) 0 D) 0XABC 9. : int m = 0, n = 0; char c = a ; scanf( % d% c% d, &m, &c, &n) ; printf( % d, % c, % d \ n, m, c, n) ; 10A10 < >, ( ) A) 10, A, 10 B) 10, a, 10 C) 10, a, 0 D) 10, A, : { nt i; for( i = 0; i < 3; i + + ) switch( i) { ase 1: printf( % d, i) ; case 2: printf( % d, i) ; default: printf( % d, i) ; ( ) A) B) 012 C) D) :
122 C { nt i = 1, j = 1, k = 2; if( ( j + + k + + ) &&i + + ) printf( % d, % d, % d \n, i, j, k) ; ( ) A) 1, 1, 2 B) 2, 2, 1 C) 2, 2, 2 D) 2, 2, : { nt a = 5, b = 4, c = 3, d = 2 ; if( a > b > c) printf( % d \ n, d) ; else f( ( c - 1 > = d) = = 1) else printf( % d \ n, d + 1) ; printf( % d \ n, d + 2) ; ( ) A) 2 B) 3 C) 4 D), 13. : { nt p[ 7] = {11, 13, 14, 15, 16, 17, 18, i = 0, k = 0; while( i < 7 &&p[ i] % 2) { k = k + p[ i] ; i + + ; printf( % d \ n, k) ; ( ) A) 58 B) 56 C) 45 D) : { nt i = 0, s = 0; do{ f( i% 2) { i + + ; continue; i + + ; s + = i; while( i < 7 ) ; printf( % d \ n, s) ; ( ) 115
123 A) 16 B) 12 C) 28 D) : { nt i = 10, j = 1; printf( % d, % d \ n, i - -, + + j) ; ( ) A) 9, 2 B) 10, 2 C) 9, 1 D) 10, : { har a, b, c, * d; a = \ ; b = \ xbc ; c = \0xab ; d = \0127 ; printf( % c% c% c% c \ n, a, b, c, * d) ;, ( ) A) a = \ ; B) b = \ xbc ; C) d = \0127 ; D) a = \ ; c = \0xab ; 17. : int f1( int x, int y) { nt t; if( x > y) t = x; else t = y; return( t) ; int f2( int x, int y) { nt t; if( x < y) t = x; else t = y; return( t) ;
124 C { nt a = 4, b = 3, c = 5, d, e, f; d = f1( a, b) ; d = f1( d, c) ; e = f2( a, b) ; e = f2( e, c) ; f = a + b + c - d - e; printf( % d, % d, % d \n, d, f, e) ; ( ) A) 3, 4, 5 B) 5, 3, 4 C) 5, 4, 3 D) 3, 5, : void f( int x, int y) { nt t; if( x < y) { t = x; x = y; y = t; { nt a = 4, b = 3, c = 5; f( a, b) ; f( a, c) ; f( b, c) ; printf( % d, % d, % d \n, a, b, c) ; ( ) A) 3, 4, 5 B) 5, 3, 4 C) 5, 4, 3 D) 4, 3, : #include stdio. h int a = 4, b = 3, * p, * q, * w; p = &a; q = &b; w = q; q = NULL; ( ) A) * q = 0; B) w = p; C) * p = a; D) * p = * w; 20. : int * f( int * x, int * y) { f( * x < * y) return x; else return y; { nt a = 7, b = 8, * p, * q, * r; p = &a; q = &b; 117
125 r = f( p, q) ; printf( % d, % d, % d \n, * p, * q, * r) ; ( ) A) 7, 8, 8 B) 7, 8, 7 C) 8, 7, 7 D) 8, 7, : { har * s[ ] = { one, two, three, * p; p = s[ 1] ; printf( % c, % s \n, * ( p + 1 ), s[ 0] ) ; ( ) A) n, two B) t, one C) w, one D) o, two 22. : { nt x[ 8] = {8, 7, 6, 5, 0, 0, * s; s = x + 3; printf( % d \ n, s[ 2] ) ; ( ) A) B) 0 C) 5 D) ( ) A) int N = 5, b[ N] [ N] ; B) int a[ 1 ] [ 2] = { {1, {3 ; C) int c[ 2 ] [ ] = { {1, 2, {3, 4 ; D) int d[ 3] [ 2] = { {1, 2, {3, 4 ; 24. : { nt m[ ] [ 3] = {1, 4, 7, 2, 5, 8, 3, 6, 9 ; int i, j, k = 2; for( i = 0; i < 3; i + + ) { printf( % d, m[ k] [ i] ) ; ( )
126 C A) B) C) D) :, #define N 10 void arrin( int x[ N] ) { nt i = 0; while( i < N) scanf( % d, ; ( ) A) x + i B) &x[ i + 1 ] C) x + ( i + + ) D) &x[ + + i] 26. : { har s[ ] = \n123 \ \ ; printf( % d, % d \ n, strlen( s), sizeof( s) ) ; ( ) A) B) 6, 7 C) 5, 6 D) 6, : fun( char * sl, char * s2) { nt i = 0; while( sl[ i] = = s2[ i] &&s2[ i]! = \0 ) i + + ; return( sl[ i] = = \0 &&s2[ i] = = \0 ) ; ( ) A) s2 s1 B) s1 s2, s1 s2, 1, 0 C) s1 s2,, 1, 0 D) s1 s2, s1 s2, 1, ( ) A) B) ( static) 119
127 C) D) auto static 29. : typedef struct { int n; char c; double x; STD;, ( ) A) STD tt[ 2 ] = {{1, A, 62, {2, B, 75 ; B) STD tt[ 2] = {1, A, 62, 2,, 75 ; C) struct tt[ 2] = { {1, A, {2, B ; D) struct tt[ 2] = { {1, A, 62. 5, {2, B, ; 30. : { nion{ unsigned int n; unsigned char c; ul; ul. c = A ; printf( % c \ n, ul. n) ; ( ) A) B) C) A D) : { har str[ ] = xyz, * ps = str; while( * ps) ps + + ; for( ps - - ; ps - str > = 0 ; ps - - ) puts( ps) ; ( ) A) yz < > xyz B) z < > yz C) z < > yz < > xyz D) x < > xy < > xyz 32. : { nt a[ ] [ 3] = { {1, 2, 3, {4, 5, 0, (* pa) [ 3], i; pa = a; fo ( i = 0; i < 3 ; i + + ) if i < 2) pa[ 1] [ i] = pa[ 1] [ i] - 1;
128 C else pa[ 1] [ i] = 1; printf( % d \ n, a[ 0] [ 1] + a[ 1] [ 1 ] + a[ 1 ] [ 2] ) ; ( ) A) 7 B) 6 C) 8 D) 33. : void fun( int * a, int i, int j) { n t; if ( i < j) { = a[ i] ; a[ i] = a[ j] ; a[ j] = t; fun( a, + + i, - - j) ; { nt a[ ] = {1, 2, 3, 4, 5, 6, i; fun( a, 0, 5) ; for( i = 0; i < 6; i + + ) printf( % d, a[ i] ) ; ( ) A) B) C) D) : main( int argc, char * argv[ ] ) { nt n, i = 0; while( argv[ 1] [ i]! = \0 ) { = fun( ) ; i + + ; printf( % d \ n, n* argc) ; int fun( ) { tatic int s = 0; s + = 1; return s; exam. exe, : exam
129 ( ) A) 6 B) 8 C) 3 D) 4 35., fun, p ( ) A) { int * p; fun( p) ;... int fun( int * p) { int s; p = &s; C) #include stdlib. h B) { int * p; fun( &p) ;... int fun( int * * p) { int s; * p = &s; { int * p; { int * p; D) #include stdlib. h fun( &p) ;... fun( p) ;... int fun( int * * p) int fun( int * p) { * p = ( int* ) malloc( 2) ;... { p = ( int* ) malloc( sizeof( int) ) ; 36. STP, STP s; char * s;, ( ) A) typedef STP char * s; B) typedef * char STP; C) typedef STP * char; D) typedef char* STP; 37. : struct ss { har name[ 10] ; int age; char sex; std[ 3], * p = std; ( ) ( ) A) scanf( % d, &( * p). age) ; B) scanf( % s, &std. name) ; C) scanf( % c, &std[ 0 ]. sex) ; D) scanf( % c, &( p - > sex) ) ; 38. char x , ( 2 + x) ( 3) A) B) C) D) ( ) A) C ASCII
130 B) C C) C, D) C, C 40. abc. txt, #, # nclude stdio. h { ILE * fout; char ch; fout = fopen( abc. txt, w ) ; ch = fgetc( stdin) ; while( ch! = # ) { putc( ch, fout) ; ch = fgetc( stdin) ; fclose( fout) ; ( ) A) fopen B) C) fgetc D) stdin 1. : int i = - 19, j = i% 4; printf( % d \n, j) ; 2. : { nt i, j; scanf( i = % d, j = % d, &i, &j) ; printf( i = % d, j = % d \n, i, j) ; i 10, j 20, 3. : 123
131 { nt p, a = 5; if p = a! = 0) el e printf( % d \ n, p) ; printf( % d \n, p + 2) ; 4. : { nt a = 4, b = 3, c = 5, t = 0; if( a < b) t = a; a = b; b = t; if( a < c) t = a; a = c; c = t; printf( % d % d % d \ n, a, b, c) ; 5. : { nt a[ 4] [ 4] = { { 1, 2, - 3, - 4, {0, - 12, - 13, 14, { - 21, 23, 0, - 24, { - 31, 32, - 33, 0 ; int i, j, s = 0; for( i = 0 ; i < 4; i + + ) { fo ( j = 0; j < 4; j + + ) { f( a[ i] [ j] < 0) continue; if( a[ i] [ j] = = 0) break; s + = a[ i] [ j] ; printf( % d \n, s) ; 6. : { har a;
132 C a = H - A + 0 ; printf( % c \n, a) ; 7. : int f( int x, int y) { return( y - x) * x; { nt a = 3, b = 4, c = 5, d; d = f( f( 3, 4), f( 3, 5 ) ) ; printf( % d \n, d) ; 8. yanghui, : : ( 1 ) 1 1; ( 2 ) ; ( 3 ) 1 #define N 6 void yanghui( int x[ N] [ N] ) { nt i, j; x[ 0] [ 0 ] = 1; for( i = 1; i < N; i + + ) { [ i] [ 0 ] = ( = 1 ; for( j = 1 ; j < i; j + + ) x[ i] [ j] = ( ; 125
133 9. s, viod dele( char * s) { nt n = 0, i; for( i = 0 ; s[ i] ; i + + ) if( s[ n + + ] = s[ i] ; s[ n] = ( ; 10. findbig findbig, { nt findbig( int, int, int) ; int ( * f) ( ), x, y, z, big; f = ( ; scanf( % d% d% d, &x, &y, &z) ; big = ( * f) ( x, y, z) ; printf( big = % d \ n, big) ; 11. ( ) #define MCRA( m) 2 * m #define MCRB( n, m) 2* MCRA( n) + m { nt i = 2, j = 3; printf( % d \ n, MCRB( j, MCRA( i) ) ) ; 12. : struct ss { int info; struct ss * link; x, y, z; :
134 y ( C 13. test. txt, : Hello, everyone!, test. txt, fr, ( ) #include stdio. h { ILE * fr; char str[ 40 ] ; fgets( str, 5, fr) ; printf( % s \ n, str) ; fclose( fr) ; 15 ( ) 1. C, ( ) A) OL B) C) & D) 216D 2. 4, ( ) A) For B) 4d C) f2 G3 D) WORD - sub DO IF void Case Size abc define 3. ( ) A) B B) \010 C) 68 D) D 4. x y double, x = 2, y = x + 3 /2 ( ) A) B) 3 C) D) ( ) A) x = y = 100 B) d - - ; C) x + y; D) c = int( a + b) ; 6. x, y, x = 10, y = 3, ( ) printf( % d, % d \ n, x - -, - - y) ; A) 10, 3 B) 9, 3 C) 9, 2 D) 10, 2 7. x, y, z int, x, y, z, 127
135 A) INPUT x y z; B) scanf( % d% d% d, &x, &y, &z) ; C) scanf( % d% d% d, x, y, z) ; D) read( % d% d% d, &x, &y, &z) ; 8. ( ) { nt a = 3; printf( % d \n, ( a + = a - = a* a) ) ; A) - 6 B) 12 C) 0 D) a, b, c, d, m, n int, a = 5, b = 6, c = 7, d = 8, m = 2, n = 2, ( m = a > b) &&( n = c > d) ;, n ( ) A) 0 B) 1 C) 2 D) : { nt x; scanf( % d, &x) ; i ( x - - < 5 ) printf( % d, x) ; else printf( % d, x + + ) ;, 5, ( ) A) 3 B) 4 C) 5 D) w, x, y, z, m int, : w = 1; x = 2; y = 3; z = 4; m = ( w > x? w: x > y? x: y > z? y: z), m ( ) A) 4 B) 3 C) 2 D) int,, t 0 while( t = l ) { ( ) A) 0 B) 1 C) D) 13. ( ) { nt num = 0;
136 C w ile( num < = 2) { num + + ; printf( % d \n, num) ; A) 1 B) 1 C) 1 D) l , ( ) A) typedef v1 int; B) typedef v2 = int; C) typedef int v3 ; D) typedef v4: int; 15.,, ( ) A) B) C), D) 16. ( ) fun ( float x ) { loat y; y = 3* x - 4; return y; A) int B) C) void D) float 17. : f ( int a) { nt b = 0; static int c = 3 ; b + + ; c + + ; return( a + b + c) ;, ( ) { nt a = 2, i; for( i = 0; i < 3 ; i + + ) printf( % d \ n, f( a) ) ; A) 7 B) 7 C) 7 D) 7 129
137 ( ) { har c = z ; printf( % c, c - 25 ) ; A) a B) z C) z - 25 D) y 19., ( ) A) \ t B) \17 C) n D) \xaa 20. : int i, j = 2, * p = &i;, i = j ( ) A) i = * p; B) * p = * &j; C) i = &j; D) i = * * p; 21., ( ) A) int a[ ] = {1, 2 ; B) char * a[ 3] ; C) char s[ 10] = test ; D) int n = 5, a[ n] ; 22. int, : int x[ 10 ] = {0, 2, 4 ;, x ( ) A) 3 B) 6 C) 10 D) ( ) { nt i, a[ 10] ; for( i = 9; i > = 0; i - - ) a[ i] = 10 - i; printf( % d% d% d, a[ 2], a[ 5], a[ 8 ] ) ; A) 258 B) 741 C) 852 D) ( ) A) int a[ 2] [ 3 ] ; B) int b[ ] [ 3] = {0, 1, 2, 3 ; C) int c[ 100] [ 100] = {0 ; D) int d[ 3] [ ] = { {1, 2, {1, 2, 3, {1, 2, 3, 4 ; 25. ( ) { nt a[ 4] [ 4 ] = { {1, 3, 5, {2, 4, 6, {3, 5, 7 ; printf( % d% d% d% d \ n, a[ 0] [ 3 ], a[ 1] [ 2], a[ 2] [ 1], a[ 3 ] [ 0] ) ;
138 C A) 0650 B) 1470 C) 5430 D) 26. ( ) { har st[ 20] = hello\0 \ t \ \ \ ; printf( % d % d \n, strlen( st), sizeof( st) ) ; A) 9 9 B) 5 20 C) D) , ( ) A) char s1[ 10] ; s1 = Ctest ; B) char s2 [ ] = { C, t, e, s, t ; C) char s3 [ 20] = Ctest ; D) char * s4 = Ctest \n ; 28. ( ) #include stdio. h amovep( int * p, int ( * a) [ 3], int n) { nt i, j; fo ( i = 0; i < n; i + + ) for j = 0 ; j < r; j + + ) * ( ( p + i* n) + j) = * ( * ( a + i) + j) ; { nt * p, a[ 3] [ 3] = { {1, 3, 5, {2, 4, 6 ; p = ( int * ) malloc( 100) ; amovep( p, a, 3) ; printf( % d % d \n, p[ 2], p[ 5] ) ; free( p) ; A) 5 6 B) 2 5 C) 3 4 D) 29. ( ) struct HAR { int x, y; struct HAR * p; h[ 2 ] ; { [ 0]. x = 1; h[ 0 ]. y = 2; h[ 1]. x = 3; h[ 1 ]. y = 4; 131
139 h[ 0]. p = &h[ 1] ; h[ 1]. p = h; printf( % d % d \n, ( h[ 0 ]. p) - > x, ( h[ 1]. p) - > y) ; A) 1 2 B) 2 3 C) 1 4 D) ( ) { nt a, b; f r( a = 1, b = 1 ; a < = 100; a + + ) { f( b > = 10 ) break; if b% 3 = = 1) { b + = 3; continue; printf( % d \ n, a) ; A) 101 B) 6 C) 5 D) ( ) union myun { truct a; { int x, y, z; u; int k; {. u. x = 4; a. u. y = 5; a. u. z = 6; a. k = 0; printf( % d \ n, a. u. x) ; A) 4 B) 5 C) 6 D) ( ) int a, b; void fun( ) { a = 100; b = 200; { nt a = 5, b = 7; fun( ) ;
140 C printf( % d % d \n, a, b) ; A) B) 5 7 C) D) ( ) #define M( x, y, z) x* y + z { nt a = 1, b = 2, c = 3; printf( % d \ n, M( a + b, b + c, c + a) ) ; A) 19 B) 17 C) 15 D) x y 0,, ( ) A) x y B) x y C) x & y D) x y 35., test. txt ( ) #include stdio. h void fun( char * fname, char * st) { ILE * myf; int i; myf = fopen( fname, w ) ; for( = 0; i < = 6; i + + ) fputc( * ( st + i), myf) ; fclose( myf) ; { un( test, new world ) ; fun( test, hello, ) ; A) hello, B) new worldhello, C) new world D) hello, rld 1. : x + + ; + + x; x = x + 1; x = l + x; x 1, ( ) : 2. y int, y :
141 { nt i = 10, j = 0; do { = j + i; i - - ; while( i > 2) ; printf( % d \n, j) ; 4. : { nt n1, n2 ; scanf( % d, &n2) ; while( n2! = 0) { n1 = n2% 10; n2 = n2 /10 ; printf( % d, n1) ;, 1298 < >, 5. int ff( int n) { tatic int f = l; f = f* n; return f; { nt i; for( i = 1 ; i < = 5; i + + ) printf( % d \ n, ff( i) ) ; 6. x y, double fun( double x, int y) { nt i; double z; for( = 1, z = 1; i < = y; i + + ) return z; z = z* ( ;
142 C 7. : { nt a, b, k = 4, m = 6, * p1 = &k, * p2 = &m; a = pl = = &m; b = ( * p1) /( * p2) + 7 ; printf( a = % d \n, a) ; printf( b = % d \ n, b) ;, a b 8. int a[ 10], i;, fun : 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; a 10, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1 fun( int a[ ] ) { nt i; for( i = 1; i < = 10; i + + ) ( = i; for( i = 0; i < 5; i + + ) ( = a[ i] ; 9. #include stdio. h { har s[ ] = 9876, * p; for ( p = s; * p! = \0 ; p + + ) putchar( * p) ; 10. : char s[ 100], d [ 100 ] ; int j = 0, i = 0; s, ( : ) while( [ i] ) { d[ j] = ( ; j + + ; d[ j] = 0 ; 11., struct STRU { nt x, y ; float rate; ( p; a, b; a. x = 0; a. y = 0; a. rate = 0; a. p = &b; 135
143 b. x = 0; b. y = 0; b. rate = 0; b. p = NULL; 12. : struct STRU { nt a, b ; char c; double d; ; struct STRU p1, p2;, t, t : [ 20 ] ; 13., fseek, ftell,, FILE * myf; ling f1; myf = ( ( test. txt, rb ) ; fseek( myf, 0, SEEK END) ; f1 = ftel( myf) ; fclose( myf) ; printf( % d \ n, f1 ) ;
144 1 C 1. 2., 3., 4. ( ) : ( ), ( RAM ROM), ( ), ( ), ( ) 4., ;, ; ( ) 5. ( ) ; ( ) 6. ; ( ) DOS DOS
145 3. 4. DOS, : ; ( TYPE, COPY, DEL, REN, XCOPY, ATTRIB) ; ( DIR, MD, CD, RD, TREE, PATH) ; ( FORMAT, DISKCOPY, CHKDSK) ; ( VER, DATE, TIME, CLS, PROMPT, HELP) ; (, ) ; ( ) Windows 1. Windows 2. Windows : 3. Windows : C ++, Access, Visual Basic, Visual FoxPro, Java C, 1. ( ) 2. 3.,, C 1. C ( 1 ), ( 2 ) ( 3 )
146 1 C ( 4 ) C 2. ( 1 ) C ( ) ( 2 ) C ( 3 ) ( 4 ) C ( ) 3. ( 1 ),, ( 2 ), ( 3 ) ( 4 ) goto 4. ( 1 ) if ( 2 ) switch ( 3 ) 5. ( 1 ) for ( 2 ) while do... while ( 3 ) continue break ( 4 ) 6. ( 1 ) ( 2 ) 7. ( 1 ) ( 2 ) ( 3 ) ( 4 ), ( 5 ),, ( 6 ) ( 7 ) ( ), ( 8 )
147 ( 1 ),, ( 2 ) 9. ( 1 ), ( 2 ), ( 3 ) ( 4 ) ( 5 ),, 10. ( ) ( ) ( 1 ) ( 2 ), 11. ( 1 ) ( 2 ) 12. ( I /O ), ( I / O ) ( 1 ) ( FILE ) ( 2 ) ( fopen, fclose) ( 3 ) ( fputc, fgetc, fputs, fgets, fread, fwrite, fprintf, fscanf ), ( rewind, fseek )
148 2 Tu rb o C Turbo C C,, C Turbo C, Turbo C C Turbo C Tur bo C Turbo C 384KB, 3MB, ( ) Turbo CTurbo C ( ), ( ), Turbo C DOS C, DOS2. 0 DOS Turbo C, Tur bo C Turbo C Borland, Turbo C Turbo C, Turbo C, Turbo C, Turbo C ( install) Turbo C install. exe ( install. exe A, CD A: A: ), install install. exe,,,,
149 ,, ( C, F ) : ( 1 ) F: \ TC : tc. exe, tcc. exe, make. exe ( 2 ) F: \ TC\ INCLUDE : stdio. h, math. h, string. h ( 3 ) F: \ TC\ LIB : maths. lib, mathl. lib, graphics. lib Tur bo C, TC tc. exe, tcc. exe tc. exe Turbo C tc. exe, : ( 1) MS-DOS, DOS, DOS : C: \ Windows > CD F: \ TC ( F: \TC) F: \ TC > tc ( tc. exe) Turbo C ( 2 ) TC, tc. exe,, TC. exe Turbo C, Tur bo C 1 Turbo C : ( 1 ) TC, 8 : File( ) Edit( ) Run( ) Compile ( ) Project( ) Options( ) Debug ( ) Break / watch( / ), ( 2 ), Edit Turbo C, Turbo C : Line 1 Col 1 Insert Indent Tab Fill Unindent F: NONAME. C
150 2 Turbo C 1 Line 1 Col 1 1 1, Line Col,, NONAME. C, NONAME. C, ( 3), Message ( 4 ) Turbo C ( ), : F1-Help( ) : F1 F5-Zoom( ) :,, F5,, F5,, F5,,, F5, F6-Switch( ) : F6 ( Message), F6, ( Edit ), 143
151 F7-Trace( ) : F8-Step( ) : F8 F9-Make( ) :,. obj. exe, F10 -Menu( ) :, File( File ) Trubo C, C, File ( TC, File ;, F10 File ),, New( 2 ),,, ( 1 1 ) 2 Turbo C,, Ins Del Ins, Ins, INSERT, (,
152 2 Turbo C ), ; Ins,, INSERT, ( ) Turbo C Ins, Ins, Del Ctrl Y ; Ctrl N,, F10, Save, TC,, 3 3 3, (,, ), : ( 1 ) TC tc. exe Turbo C, F: \ TC,, ( 2 ) NONAME. C,, NONAME. C,, NONAME. C, C1. C, F: \ TC\ C1. C,, TC, C1. C TC,, F: \ TC\ ZHANG \ C1. C,, TC ZHANG : C1. C, C1. C TC 145
153 C1. C, C1. C, NONAME. C, C1. C,, Save,,, F10, FileSave, : F2, ( ) F2, F10, File Load, *. C, TC ZHANG C1. C,, 4,, F3 F3, F10, FileLoad 4 ( ),, ( ),,,, *. C, Turbo C. C,
154 2 Turbo C,,, F2, File ( Alt + F File ), Write to, New Name, 5 C1. C, ( C2. C),, ( ), C2. C, 5, C2. C ZHANG,, F: \ TC\ ZHANG \C2. C 5,,, C, QBASIC,,,, TC cd, TC, TC : Alt + F File, Change dir ( Change dir ), New Directory, F: \ TC, ( 147
155 F: \TC Turbo C, ) F: \ TC\ ZHANG, Turbo C ZHANG, Turbo C New Directory F: \ TC \ ZHANG, 6 (. obj. exe ),, 6,,,, TC,, (. obj ) (. exe ) F: \ TC\ ZHANG OUT, TC, TC: Turbo C Turbo C,, F: \ TC, TC INCLUDE, LIB Turbo C,, Turbo C, Turbo C
156 2 Turbo C Turbo C, Options, Options ( Alt + O ),, Directories, : ( 1 ) Include directories: F: \ TC \ INCLUDEInstall ( 2 ) Library directories: F: \TC \LIBInstall ( 3 ) Output directory: *. exe *. obj ( 4 ) Turbo C directory: F: \ TCInstall 1 Include directories, F: \TC \INCLUDE 2 Library directories, F: \TC\LIB 3 Output directory (. obj. exe ), 7,,, 3 Output directory ( ),, Output Directory, F: \TC \ZHANG OUT, 8,. obj. exe F: \ TC\ ZHANG OUT,, F: \ TC \ ZHANG OUT 3 Output directory:, 4 Turbo C directory Turbo C, F: \ TC, 149
157 8,, ( config) Turbo C tcconfig. tctc, TC tcconfig. tc,, : Esc Options, Save Options,, Config File, 9 TCCONFIG. TC,, TCCONFIG. TC 9 TCCONFIG. TC, TC,,, TC, TC ( ), Options Directories,, Save Options
158 2 Turbo C,,,. obj. exe,, DOS \ TC\ tcturbo C,. obj. exe, Windows TC ( ), TC tc. exe Turbo C, Alt + F File, Change dir ( ),, Turbo C,,,,,, 1. ( 1 ) F10, Compile ( Alt + C ), Compile, Compile to OBJ,
159 cl. c, cl. obj, L cl. obj TCCONFIG. TC,, (. exe),. exe F10 CompileLink EXE File, ( Alt + C L ),, TCCONFIG. TC cl. exe,,. obj, ( 2 ) Alt + C ( F10 Compile) Compile, Make EXE file,, TCCONFIG. TC c1. obj c1. exe, Turbo C, F9 -Make : F9 ( Compile) Make EXE file,, F9 2.,,. obj (. obj ), Turbo C,,,, : Turbo C,, c1 1. c c1 2. C, TC, 11 File Write to, c1. PRJc1
160 2 Turbo C ( ),. PRJ, ( PRJ project ) Alt + P ( F10 Project, ) ( Project) Project name,, Project Name, ( *. PRJ, ) c1. PRJ, c1. PRJ, ( 12), Alt + C Compile, Make EXE file,, c1 1. OBJ c1 2. OBJ c1. EXE :,, : c1 1 c1 2 : c1 1. C c1 2. C, : 153
161 F: \ TC\ ZHANG \c1 1 F: \ TC\ ZHANG \c1 2, c1 1. C c1 2. C, c1 1. OBJ c1 2. OBJ, : c1 1. OBJ c1 2. OBJ Make EXE filef9, (. PRJ ) Project name,,,, Project name ( Project Clear Project ),. RPJ, Make EXE file C1. RPJ, Make EXE file F: C1. EXE, C1, NONAME. EXE( NONAME. C) Compile to OBJ( Make EXE file),, Compile to OBJ 3. ( 1 ),, 13 : Compiling 1 A1. C 2 A1. C 7, 0, KB 1 ( Success),,, 14 : A1. EXE,
162 2 Turbo C F TC LIB CS. LIB,,, ( 2 ), : { nt a, b, d; a = 3 ; b = 5 c = a + b; 155
163 d = 7; printf( % d, % d, % d \ n, a, b, c, ) ; F9, , 1 2 ( Warnings),,, ( Errors),,,,, Message,, , 5, : Statement missing; in function main( ) 16,, Edit 5, 4, 5 5? 4,,, C, 5, 5
164 2 Turbo C 16 5, 5, 5,,,,, 5,, 4, 2 F6 Message, 2,
165 Message 2, 7, : Undefined symbol c in function main( c ) 7, c,,, 7, 2 : int a, b, c, d; 3 8 : d is assigned a value which is never used in function main( d, ), d,,,,, d,,,,,,. obj. exe ( ) 8, 8, 7 d, 8, 7 : printf ( % d, % d, % d, % d \n, a, b, c, d) ; a, b, c, d, F9, 18 18
166 2 Turbo C 18, ( ),,, ( ),, 4.,,,, : Alt + P Project, Break make on,, Errors, Break make on Errors, 19 19,,, Warnings,, ( Warnings Errors),,, Break make on Fatal errors,,, Link, 159
167 ,. OBJ. EXE,, ( 1 ) DOS. EXE, C1. EXE, : F: \ TC\ ZHANG > 1 ( ) C1. EXE, C1. EXE \ TC\ OUT, : F: \ TC\ ZHANG > TC\OUT\ C1,,. OBJ ( 2 ) TC F10, Run, ( Alt + R ), Run, Run, ( 3 ) Ctrl + F9 20, Run Run Ctrl - F9, Run Ctrl + F9,, TC Ctrl + F9,, Ctrl + F9,,,, Ctrl
168 2 Turbo C + F9 Turbo C Turbo C,,, Ctrl + F9 ;,, ( scanf ),, : { nt a, b, c; scanf( % d, % d, % d \n, &a, &b, &c) ; printf( a = % d, b = % d, c = % d \ n, a, b, c) ; Ctrl F9,,, : 2, 4, 6( 21), TC,, Run User screen ( User screen ) Alt + F5,, 22, printf 21 22,, TC : F9: Ctrl + F9 : Alt + F5:, TC 161
169 , 1. :,,, [ 1] :, : :, s = ( a + b + c) /2 : # include math. h { loat a, b, c, s, area; = s( s - a) ( s - b) ( s - c) scanf( % f, % f, % f, &a, &b, &c) ; s = ( a + b + c) /2; area = sqrt( s* ( s - a) * ( s - b) * ( s - c) ) ; printf( area = % d \n, area) ;, : 2. 5, 3. 6, 4. 7 : area = 0,,, F7, main ( ), Watch F7, 4 ( 3,, ), 23, main ( ), scanf, F7, 4 4 scanf,,,
170 2 Turbo C 23 : 2. 5, 3. 6, 4. 7,, 5, 4 F7, 6, 5 Ctrl + F7, a, a, 24 24, Watch a 2. 5, 25 b, Ctrl + F7, Add Watch b,, Watch b
171 25 c 4. 7, s 5. 4, Watch : s : 5. 4 c : 4. 7 b : 3. 6 a : 2. 5 a, s,, F7, 7, 6 Ctrl + F7, Add Watch area, Watch area , 0, printf 0? F7, 8, 7,, Watch area , area, printf printf,, Alt + F5, area = 0,, printf,,, % d, % d % f, Ctrl + F9 2. 5, 3. 6, 4. 7, : area = ,,,, F7 Ctrl +
172 2 Turbo C F7, Run Trace into ( 26), F7 Break /watch, Add watch( 27 ),, Add Watch, Ctrl + F7, ,,,,,,,,,,,,, :, Ctrl + F8,,,, Ctrl + F8,,,,, Ctrl + F9 [ 2] ax 2 + bx + c = 0, x1 x2, : 165
173 : x1 = p + q, x2 = p - q, : # include math. h { loat a, b, c, disc, p, q, x1, x2; scanf( % f, % f, % f, &a, &b, &c) ; disc = b* b - 4* a* c; p = - b /( 2 * a) ; q = sqrt( disc) /( 2 * a) ; x1 = p + q; x2 = p - q; p = - b 2a, q = b 2-4ac 2a printf( x1 = % d, x2 = % d \n, x1, x2) ; Ctrl + F9, a, b, c 1, 2, 1, Alt + F5, : x1 = 0, x2 = 0, 6 11,, Ctrl + F8, Ctrl + F9, scanf,, a, b, c : 1, 2, 1,,, disc, Ctrl + F7, Add Watch disc, Watch disc: 0. 0, disc = b 2-4ac 0, disc = 0,, Ctrl + F9,, printf Ctrl + F7 x1 x2, Watch x1 x2-1. 0,, 28,, x1 x2, % d, printf % d % f,, :
174 2 Turbo C 28 x1 = , x2 = ( ), a, b, c 2, 3, 5, Ctrl + F7 disc Watch : disc: ,,, disc, x1 = p + q;, Ctrl + F9, q = sqrt( disc) / ( 2 * a) ; (, TC ), Alt + F5, : sqrt: DOMAIN error Floating point error: Overflow sqrt, ( sqrt 0, ),, printf a, b, c,, a, b, c b 2-4ac0, TC Debug Debug Evaluate 29, Ctrl + F4 Evaluate,,, 167
175 29 [ 3] ax 2 + bx + c = 0, a, b, c, disc < 0,, a c, b, disc0 b ( ) b, 2 : # include math. h { loat a, b, c, disc, p, q, x1, x2; scanf( % f, % f, % f, &a, &b, &c) ; do{ isc = b* b - 4* a* c; while( disc < 0) ; p = - b /( 2 * a) ; q = sqrt( disc) /( 2 * a) ; x1 = p + q; x2 = p - q; printf( x1 = % f, x2 = % f\ n, x1, x2) ; do... while, b disc b, b, 3 F7,, a, b, c 2, 3, 5,, TC, 6 F7, 7, disc disc, Ctrl + F4 ( Debug Evaluate ), 3, : Evaluate( ) Result( ) New value ( ) disc, Evaluate disc, Result disc < 0,, b b,
176 2 Turbo C Evaluate b,, Result b 3. 0 New value, b 4,,, Result 4. 0, 30 30, b F7, 6 ( disc < 0 ), F7, 7, disc Ctrl + F4 Evaluate, Evaluate disc, Result disc , b Evaluate b, New value b 5, F7, disc b, b 6, disc b 7, disc 9. 0 disc,, b = 7,,,,,,, Tur bo C TC,,, 169
177 1. File 1 File 1 File Load,,, *. C *. PRJ,, Pick New Save Write to Directory Change dir Os shell Pick, TC ( 8 ),, Pick, Alt + F3 Pick File Load( F3) Pick, Load file File Load, ( NONAME. C) ( NONAME. C), TC,,, DOS cd TC, DOSTC, exit TC Quit TC, DOS 2. Edit TC Edit, Edit,, Turbo C 2 TC
178 2 Turbo C 2 TC Ctrl + A Ctrl + F Ctrl + QR Ctrl + QC Ctrl + QE Home Ctrl + QX End Ctrl + QP Ctrl + W Page Up Ctrl + Z Page Down Ctrl + QB Ctrl + QK Insert Insert on / off Ctrl + Y Del Ctrl + T Backspace Ctrl + QY Ctrl + N Ctrl + KB Ctrl + KH / Ctrl + KK Ctrl + KV Ctrl + KT Ctrl + KR Ctrl + KC Ctrl + KW Ctrl + KY Ctrl + U Ctrl + KQ Ctrl + P Ctrl + QF Ctrl + OI Indent on / off Ctrl + QA Ctrl + OT Tab on / off Ctrl + QV Ctrl + F1 Tab Ctrl + KD : Ctrl + QE Ctrl Q E 171
179 3. Run 3 Run 3 Run Debug Run Source debug on, ;, Program rest Go to cursor Trace into Step over User screen,,,,, ESC,,,, ( ) 4. Compile 4 Compile 4 Compile, Primary C file Compile to OBJ Make EXE file Primary C file,. C,. OBJ. EXE. OBJ,. OBJ,,. EXE. OBJ. EXE,,. OBJ : Project name. PRJ ; Primary C file. C ;. C
180 2 Turbo C Link EXE file Build all Primary C file Get info. OBJ,. EXE CompileMake EXE file,,, Make,, 5. Pr oject 5 Project 5 Pr oject Project name Break make on Auto dependencies Clear project Remove message,. PRJ. EXE. PRJ Make, 4 : Warning:, ( Warning), Error:,, Fatal Error:,, Link: Make,. OBJ On:. C. OBJ TC. OBJ. C. OBJ, Off: Project name 173
181 6. Debug 6 Debug 6 Debug Evaluate Call stack Find function Refresh display, 3 : ( Evaluate) ( Result) ( New value), BreakWatchAdd watch,,,,, 3 : Smart( ) :, Display swapping None: Always:, 3 : Source debugging On:, Standalone:, Turbo debugger None: 7. Break / watch 7 Break / watch 7 Break / watch Add watch Add watch,, Watch
182 2 Turbo C Delete watch Edit watch Remove all watches Toggle breakpoint Clear all breakpoint View next breakpoint Watch, Del Ctrl + Y, ( Watch ), 8. Options Options 7 Options,, ( 1 ) Compiler, 8 8 Model, Tiny, Small, Medium, Compact, Large, Huge 6 Defines, Code generation, 175
183 Optimization, Source,, : Identifier length:, 32, 1 32 Nested comments: On ; Off ANSI keywords only: On ANSI C, Turbo C ; Off Turbo C Errors Names, BSS,, ( 2 ), 9 9 Map file On:. MAP Off: Initialize segments Default libraries On: ( ) Off:,, On: Off:
184 2 Turbo C Graphics library Warn duplicate Symbols Stack warning Case-sensitive link On: ( ) Off:,, Off. PRJ Graphics. lib,. OBJ. LIB On:. OBJ. LIB Off: No stack On: No stack ( Small ) Off: No stack On: Off: ( 3 ) Environment :,, Message tracking Keep message Config auto save, TC Current file: All file: Off: Make Yes:, Make No: Make On: Run / Run File / Os shell( Quit ),, TC Off: 177
185 Edit save auto On: Run / Run File / Os shell( Quit), Off: Backup files On:,. BAK,, Off: Tab size Zoomed windows Screen size ( Tab) 8, 2 16( Tab mode on) F5, ( ),, 25, EGA 43, VGA 50 ( 4 ) Directories,, Include directories Library directories Output directory Turbo C directory Pick file name Current pick file TC, pick TCPICK. TCP, TC pick, Current pick file ; pick, pick pick,
186 2 Turbo C 9.,, F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 Shift + F10 Alt + F5 Alt + F7 Alt + F8 Alt + F9 Ctrl + F1 Ctrl + F2 Ctrl + F3 Ctrl + F4 Ctrl + F7 Ctrl + F8 Ctrl + F9, TC, FileSave, FileLoad, RunGo to cursor, OptionsEnviornmentZoomed windows,, RunTrace into,, RunStep over, CompileMake, RunUser screen,. OBJ, DebugCall stack, DebugEvaluate, BreakWatchAdd watch, BreakWatchToggle breakpoint, RunRun 179
187 Alt + C Alt + D Alt + E Alt + F Alt + O Alt + P Alt + R Alt + X Esc Debug File Options Project Run TC, DOS Tur bo C Turbo C : ( 1) ( fatal error) :,,, ( 2) ( error) :, ( ) ( 3) ( warning) :,,,,, : C,,, 1.
188 2 Turbo C ( Bad call of inline function ) Irreducible expression tree Register allocation failure, 2. # operator not followed by macro argument name#,# # xxxxxxxx not an argument xxxxxxxx, Ambiguous symbol xxxxxxxx xxxxxxxx ( ),, Argument # missing name #, Argument list syntax error,, 181
189 Array bound missing ( ] ), Array size too large, Assembler statement too long 480 Bad configuration file TURBOC. CFG ( - ) Bad file name format in include directive ( filename. h ) ( < filename. h > ),, ( ) Bad ifdef directive syntax ifdef #ifdef ( ) Bad ifndef directive syntax ifndef #ifndef ( ) Bad undef directive syntax undef #undef ( ) Bad file size syntax 1 16 Call of non-function,
190 Cannot modify a constant object 2 Turbo C ( ) Case outside of switch case switch case switch, Case statement missing: case : case Case syntax error case case Character constant too long Compound statement missing,, Conflicting type modifiers, ( near far) ;,, ( cdecl pascal interrupt) Constant expression required #define Could not find file xxxxxxxx. xxx Declaration missing ; ; xxxxxxxx. xxx, ( ; ) 183
191 Declaration needs type or storage class, i, j; Declaration syntax error, Default outside of switch Default switch default switch, Define directive needs an identifier Define # define, Division by zero, Do statement must have while do while while do, Do while statement missing ( do while ( do, while Do while statement missing ) do while ) do, Do while statement missing; do while do, Duplicate case case switch case Enum syntax error enum enum
192 Enumeration constant syntax error emum, 2 Turbo C Error Directive: xxxx : xxxx #error, Error writing output file,, Expression syntax error,, Extra parameter in call, Extra parameter in call to xxxxxx xxxxxx ( ) File name too long #include, DOS 64 For statement missing ( for ( for For statement missing ) for ) for, For statement missing ; for ; for, Function call missing ) ) 185
193 , Function definition out of place,, Function doesn t take a variable of argument va start, Goto statement missing label goto goto If statement missing ( if ( if, if If statement missing ) if ) if, Illegal character c ( 0 xxx) c ( 0xXX), Illegal initialization, extern, static Illegal octal digit ( 8 9) Illegal pointer subtraction Illegal structure operation
194 2 Turbo C (. ) ( &) ( = ),, Illegal use of floating point (? : ) ( * ), Illegal use of point ( * ), Improper use of a typedef symbol typedef typedef, In-line assembly not allowed,, TCC Incompatible storage class extern, static ( ) Incompatible type conversion,,,, xxxxxxxx Incorrect command line argument: xxxxxx Incorrect configuration file argument: xxxxxxxx : xxxxxx : 187
195 ( -) Incorrect number format Incorrect use of default default default Initialize syntax error, Invalid indirection ( * ) Invalid macro argument separator,, Invalid pointer addition Invalid use of arrow Invalid use of dot (. ) L value required, Macro argument syntax error
196 2 Turbo C, Macro expansion too long 4 096, May complied only one file when an output file name is given, - o,,, Mismatch number of parameters in definition Misplaced break break break switch Misplaced continue continue continue Misplaced decimal point Misplaced else else else if else, if Misplaced elif directive elif #elif #if #ifdef #ifndef Misplaced else directive else #else #if #ifdef #ifndef 189
197 Misplaced endif directive endif #endif #if #ifdef #ifndef Must be addressable ( &), Must take address of memory location ( &) ( &), No file name ending #include, ( ) ( > ) No file name giver Turbo C ( TCC) Non-portable pointer assignment,, Non-portable pointer comparison ( ), Non-portable pointer conversion,,, Not an allowed type, Out of memory,
198 2 Turbo C Pointer required on left side of - > - > - > Redeclaration of xxxxxxxx xxxxxxxx Size of structure or array not known ( sizeof ), ;, Statement missing ; ; Structure or union syntax error ( ) structure union ( { ) Structure size too large,, Subscripting missing ] ] Switch statement missing ( ( switch, switch Switch statement missing ) ) switch, Too few parameters in call ( ) 191
199 Too few parameter in call to xxxxxx xxxxxx ( ), Too many cases case switch 257 case Too many decimal points Too many default cases default switch default Too many exponents Too many initializers Too many storage classes in declaration Too many types in declaration : char int float double struct union enum typedef Too much auto memory in function Too much code define in file 64K
200 2 Turbo C Too much global data define in file 64K, Two consecutive dots (... ), (. ), C Type mismatch in parameter # #, #N( N 1) Type mismatch in parameter # in call to xxxxxx xxxxxx, ( N 1) Type mismatch in parameter xxxxxxx xxxxxxx, Type mismatch in parameter xxxxxxxxin call to yyyyyyyy yyyyyyyy xxxxxxxx, Type mismatch in redeclaration of xxx,, extern Unable to create output file xxxxxx. xxx xxxxxx. xxx, ;, 193
201 Unable to create turboc. lnk turboc. lnk turboc. lnk, Unable to execute command xxxxxxxx TLINK MASM, xxxxxxxx Unable to open include file xxxxxxxx. xxx xxxxxxxx. xxx #include, CONFIG. SYS ( files = 20) Unable to open input file xxxxxxx. xxx xxxxxxx. xxx Undefined label xxxxxxxx goto xxxxxxxx Undefined structure xxxxxxxx xxxxxxxx Undefined symbol xxxxxxxx xxxxxxxx,, Unexpected end of file in comment started on line ( * / )
202 2 Turbo C Unexpected end of file in conditional started on line # # #endif, #endif Unknown preprocessor directive xxx xxx #, : define undef line if ifdef inndef include else endif Unterminated character constant Unterminated string Unterminated string or character constant User break Ctrl + Break While statement missing ( while ( while, while While statement missing ) while ) while, while Wrong number of arguments in of xxxxxx, 3. xxxxxxxx declared but never used xxxxxx xxxxxxxx, 195
203 , xxxxxxx is assigned a value which is never used xxxxxxx, xxxxxxxx not part of structure xxxxxxxx (. ) ( - > ),, Ambiguous operators need parentheses, ;,, Both return and return of a value used, return return, return Call to function with prototype,, Call to function xxxxwith prototype xxxx, xxxx, Code has no effect, a + b ;,, Constant is long long 32767, 65535, I L, long
204 Constant out of range in comparison 2 Turbo C, ( ), unsigned ( : ( unsigned) 65535) U u ( : u) Conversion may lose significant digits, long unsigned long int unsigned int, int long,,, 4000, - 1, 8087, - 1 Function should return a value int, void, int, C, void Mixing pointers to signed and unsigned char signed unsigned char,, No decaration for function xxxxxxxx xxxxxxxx,,, ( ) Non-portable point assignment,, Non-portable pointer comparison ( ) 197
205 , Non-portable return type conversion return,,,, Parameter xxxxxxxx is never used xxxxxxxx,, ( ),, Possible use of xxxxxxxbefore definition xxxxxxx,,,, Possible incorrect assignment ( if while do... while ),,,, : if( a = b) if( ( a = b)! = 0) Redefinition of xxxxxxxx is not identical xxxxxxxx,, Restaring compiler using assembly - B # programe inline asm,
206 2 Turbo C Structure passed by value,,, ( &), Superfluous & with function or array & ( &), Suspicious pointer conversion,, Undefined structure xxxxxxxx xxxxxxxx, Unknown assembler instruction,, Unreachable code break continue goto return while do for, Void function may not return a value void void,, Zero length structure, 199
207 C, obj, exe , ( ), 7. 2, 4, , f / * * / 16. ; ( ) d, f, c 19. % f, x 20. scanf( % d% d, &a, &b) ; 21. printf( % 5d% 5d \ n, a, b) ; 22. printf( % 6. 2f, 6. 2f \n, x, y) ;
208 A C A B A A C A B B C C A C A A D C C D A B 1. int float long int 2. c = yc = y 3. % D % d 4. printf( % f, % d, a, x) ; printf( % f, % d, x, a) ; 5. int i = 0, j = 0, k = 0; 1. x = 2, y = 3 2. c = 1 1. m in( ) { loat x, y; 2. m in( ) scanf( % f, % f, &x, &y) ; printf( x + y = % f, x - y = % f\ n, x + y, x - y) ; printf( x* y = % f, xy = % f\ n, x* y, x / y) ; { loat f, c; scanf( % f, &f) ; c = 5. 0 /9* ( f - 32) ; 201
209 printf( wendu: % f \n, c) ; 3. include math. h { loat a, b, av, s1, s2; scanf( % f, % f, &a, &b) ; av = a* b; s1 = sqrt( a* a + b* b) ; s2 = 2 * ( a + b) ; printf( av = % f, s1 = % f, s2 = % f\ n, av, s1, s2) ; 4. include math. h { loat v0, q, s, g = 9. 8; scanf( % f, % f, &v0, &q) ; s = 2* v0 * v0* sin( q) * cos( q) / g; printf( s = % f\ n, s) ; A A B C A C D B C C D A B C A D A D D D D B D B
210 , 0 2. > > = < < = = =! =, &&! 3. > > = < < = 4.! 5. * / % 6.! && 7. ( 1) 0, ( 2) 0, ( 3) 0, ( 4) 1 8. a < c b < c 9. a < 0&&b < 0 a < 0&&c < 0 b < 0&&c < x < = 100&&x > = 0 x < a = = b&&b == c&&a = = c, a = = b b = = c a == c 12. ( 1 ) 1, ( 2 ) 0, ( 3 ) 1, ( 4 ) 1, ( 5 ) switch B A D A B C D C B D A B A D B A C A 1. ( a > b) ( ; ) 2. if( a > b) { c = a; a = b; b = c; 203
211 1. a = 3 b = 2 c = 2 2. a = 2 b = 1 c = 2 3. z = x = m in( ) { nt m; float n; printf( : ) ; scanf( % d, &m) ; if 2. m in( ) m < 0) printf( ) ; else if( m < 10) n = m* 2. 85; else if( m < 100 ) n = m* * ( ) ; else n = m* 2. 85* ( ) ; printf( % f\ n, n) ; { nt a, b, c, d, min; 3. m in( ) scanf( % d% d% d, &a, &b, &c) ; d = a < b? a: b; min = d < c? d: c; printf( % d \ n, min) ; { loat s; scanf( % f, &s) ; i ( s > 100) printf( ) ; e se if( s > = 80) printf( very good! ) ; e se if( s > = 60) printf( good! ) ; e se if( s > = 40) printf( fair ) ; else printf( pool ) ;
212 3 4. ain( ) { nt s; char ch; scanf( % d, &s) ; switch( s /10) { ase 10: case 9: ch = A ; break; case 8: ch = B; break; case 7: ch = C ; break; case 6: ch = D ; break; default: ch = E ; printf( grade is % c \n, ch) ; , , a! = 0 7. c! = \ n, c > = 0 &&c < = , * x + 4* y = = t = - t 11. break D A D C B A D A B C 205
213 ( 1) 18( 2) D C C C C C A B C 1. 2 : for( i = 1; i < = 5; i + + ) s = s + i; 2. 1 : s = 1; 1. = 2 y = 3 x = 5 y = 8 x = 13 y = 21 x = 34 y = i = x = 10, y = * 1* * * * 3* * 6. 8, * #* #* # 9. * # 1. define N 5 m in( ) { nt a[ N] [ 2], m1 = 0, n2 = 0, i, j; for( i = 0; i < N; i + + ) { canf( % d% d, &a[ i] [ 0 ], &a[ i] [ 1] ) ;
214 3 : if( ( a[ i] [ 0] - 60 ) * ( a[ i] [ 1] - 60) < 0 ) m1 + + ; if( ( a[ i] [ 0] < 60 ) &&( a[ i] [ 1] < 60) ) n2 + + ; printf( = % d, = % d \ n, m1, n2) ; { nt n = 10, m1 = 0, n2 = 0, a, b, i; 2. ain( ) f r( i = 1; i < = n; i + + ) { canf( % d% d, &a, &b) ; if( ( a - 60) * ( b - 60) < 0) m1 + + ; if( ( a < 60) &&( b < 60) ) n2 + + ; printf( = % d, = % d \ n, m1, n2) ; { nt x, m = 0, n = 0, mv = 0, nv = 0; 3. ain( ) scanf( % d, &x) ; w ile( x! = 0) { i ( x > 0) { m + + ; mv + = x; else { n + + ; nv + = x; scanf( % d, &x) ; printf( % d, % d; % d, % d, m, mv /m, n, nv / n) ; { nt i; float s; 4. ain( ) f r( i = 5; i < = 150; i + = 5) { i ( i < = 50) s = i* 1. 5 ; else s = i* ( i - 50) * 0. 6; printf( % d, % f\ n, i, s) ; { nt a[ 30] [ 6], i, j, s; f r( i = 0; i < 30 ; i + + ) { = 0 ; 207
215 f r( j = 0; j < 5 ; j + + ) { canf( % d, &a[ i] [ j] ) ; s + = a[ i] [ j] ; a[ i] [ 5] = s /5; printf( avreages = % d \ n, a[ i] [ 5 ] ) ; : ain( ) { nt a1, a2, a3, a4, a5, i, j, s; f r( i = 1; i < = 30; i + + ) { rintf( % d :, i) ; scanf( % d% d% d% d% d, &a1, &a2, &a3, &a4, &a5) ; s = ( a1 + a2 + a3 + a4 + a5) /5; printf( = % d \ n, s) ; , a 2. 9, 0, 10, x 3. char str[ ] = { Lei ; B B D D C C B D D C C D B D C A B D D C
216 3 21 A , 3 i = 1 i = 0 1. s = ain( ) { nt a[ 100 ], min, i, j, t; fo ( i = 0; i < = 99 ; i + + ) scanf( % d, &a[ i] ) ; j = 0; for i = 1; i < = 99; i + + ) if( a[ j] > a[ i] ) { j = i; i ( j! = 0) { t = a[ j] ; a[ j] = a[ 0] ; a[ 0] = t; 2. # efine N 6 printf( the new sort: ) ; f r( i = 0; i < = 99; i + + ) printf( % 5d, a[ i] ) ; { nt i; float a[ N], max, min, sum; fo ( i = 0; i < N; i + + ) 209
217 scanf( % f, &a[ i] ) ; sum = min = max = a[ 0] ; for i = 1; i < N; i + + ) { f( max < a[ i] ) max = a[ i] ; if( min > a[ i] ) min = a[ i] ; sum + = a[ i] ; sum = ( sum - max - min) / ( N - 2) ; printf( zuihou defen: %. 2f \n, sum) ; 3. include stdio. h define M 5 # efine N 6 { nt a[ M] [ N] ; int max, min, sum; int b[ M + 1] ; int i, j, t; for( i = 0; i < M; i + + ) { rintf( ( % d) hao defen wei:, i + 1) ; for( j = 0 ; j < N - 1; j + + ) scanf( % d, &a[ i] [ j] ) ; f r( i = 0; i < M; i + + ) { ax = min = a[ i] [ 0] ; sum = 0; f r( j = 0; j < N - 1; j + + ) { f( max < a[ i] [ j] ) max = a[ i] [ j] ; if( min > a[ i] [ j] ) min = a[ i] [ j] ; sum + = a[ i] [ j] ; a[ i] [ N - 1 ] = ( sum - max - min) / ( N - 3) ; printf( ( % d) hao zuihaopingfen = % d \ n, i + 1, a[ i] [ N - 1] ) ; for( i = 0; i < M; i + + ) { b[ i] = a[ i] [ N - 1 ] ; b[ M] = 0;
218 3 printf( \ nmingcipailie wei: \ n ) ; for( i = 0; i < M; i + + ) { ax = 0; for( j = 1 ; j < = M; j + + ) { if( b[ max] < b[ j] ) max = j; printf( ( % d) hao zongfenshi % d \ n, max + 1, b[ max] ) ; b[ max] = 0; 7 1., ( auto) A C D D A D C D C C C A D C 1. 5, ,
219 C A A B B C C D A B C A A C B B B D D A D D C C A B B C A A B D D B C A B C B D D B B A D A D A A A B B C A D D D A
220 C C C C A C A B B 1. a /( b* c) a / b /c rewind fseek 4. oid fun ( int * q) void fun ( int q[ ] ) void fun ( int q[ M] ) w[ i - 1] 7. a, pb pa, pc pb, pc A C B A C D C C B C D C A A D A B D B D C B D A B D C A D D 213
221 C A B B C D B D A C 1. 20, X 4. 3, 2 5. / i , d1. dat, rb 10. * k 11. ax < a[ row] [ col] min > max 12. t * s - * t C A B D B A D C A A C B D A B D C D A B
222 C B D C C C C B A C C A A A C D B D D A i = 10, j = [ i] [ i] x[ i - 1 ] [ j - 1] + x[ i - 1] [ j] 9. ( s[ i] > = 0 &&s[ i] < = 9 ) \0 10. findbig x. link = y. link; 13. Hell A C B D B D B D C B A B B C B A A A C B 215
223 D D C D A B A A D D D B D D A 1. x + = 1; 2. ( y% 2) = = x 7. 0, 7 8. a[ i - 1 ], a[ 9 - i] s[ i + + ] 11. struct STRU * 12. struct STRU 13. fopen
1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7
1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7-80097 - 564-9 /TP 8 : 10. 00 ,,,, 1994 NCRE,,, ( ),,,,,
新版 明解C言語入門編
328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66
C/C++ - 文件IO
C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;
新・解きながら学ぶC言語
330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180
新・明解C言語入門編『索引』
!... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177
nooog
C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1
CC213
: (Ken-Yi Lee), E-mail: [email protected] 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,
C 1
C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=
( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)
( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.
プログラムの設計と実現II
UNIX C ls mkdir man http://www.tj.chiba-u.jp/lecture/prog2/ Ctrl+x, Ctrl+s ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall
FY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
_汪_文前新ok[3.1].doc
普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向
C/C++ - 函数
C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh
新版 明解C++入門編
511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,
C/C++ - 字符输入输出和字符确认
C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,
C/C++语言 - C/C++数据
C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;
Ps22Pdf
C ( CIP) C /. :, 2001. 7 21 ISBN 7-5624 -2355-5. C........ C. TP312 CIP ( 2001 ) 034496 C * * : 7871092 1 /16 : 14. 25 : 356 20017 1 20017 1 : 1 6 000 ISBN 7-5624-2355-5 / TP311 : 21. 00 C, C,,,, C,, (
Ps22Pdf
( 98 ) C ( ) ( )158 1998 C : C C C,,, C,, : C ( ) : : (, 100084) : : : 7871092 1/ 16 :18 25 :415 : 2000 3 1 2000 3 1 : ISBN 7 302 01166 4/ T P432 : 00016000 : 22 00 ( 98 ) 20 90,,, ;,,, 1994, 1998, 160,
C/C++ - 字符串与字符串函数
C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed
C/C++程序设计 - 字符串与格式化输入/输出
C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int
CC213
: (Ken-Yi Lee), E-mail: [email protected] 177 [P179] (1) - [P181] [P182] (2) - for [P183] (3) - switch [P184] [P187] [P189] [P194] 178 [ ]; : : int var; : int var[3]; var 2293620 var[0] var[1] 2293620
C/C++ 语言 - 循环
C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf
6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit
6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128
C C
C C 2017 3 8 1. 2. 3. 4. char 5. 2/101 C 1. 3/101 C C = 5 (F 32). 9 F C 4/101 C 1 // fal2cel.c: Convert Fah temperature to Cel temperature 2 #include 3 int main(void) 4 { 5 float fah, cel; 6 printf("please
C
C 14 2017 5 31 1. 2. 3. 4. 5. 2/101 C 1. ( ) 4/101 C C ASCII ASCII ASCII 5/101 C 10000 00100111 00010000 ASCII 10000 31H 30H 30H 30H 30H 1 0 0 0 0 0 ASCII 6/101 C 7/101 C ( ) ( ) 8/101 C UNIX ANSI C 9/101
四川省普通高等学校
四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9
int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;
Memory & Pointer [email protected] 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,
C/C++ - 数组与指针
C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 float candy [ 365]; char code [12]; int states [50]; 2 int array [6] = {1, 2, 4, 6, 8, 10}; 3 // day_mon1.c: # include # define MONTHS 12 int
C/C++语言 - 分支结构
C/C++ Table of contents 1. if 2. if else 3. 4. 5. 6. continue break 7. switch 1 if if i // colddays.c: # include int main ( void ) { const int FREEZING = 0; float temperature ; int cold_ days
C
C 2017 3 14 1. 2. 3. 4. 2/95 C 1. 3/95 C I 1 // talkback.c: 2 #include 3 #include 4 #define DENSITY 62.4 5 int main(void) 6 { 7 float weight, volume; 8 int size; 9 unsigned long letters;
epub 33-8
8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE
. (A) (B) (C) A (D) (E). (A)(B)(C)(D)(E) A
. () () () () () (A) (B) (C) B (D) (E). (A) (B) (C) E (D) (E) (A) (B) (C) (D). () () () () E (A) (B) (C) (D) (E). C (A) (B) (C) (D) (E). (A) (B) (C) (D) D (E). () - () - () - () - () - D (A) (B) (C) (D)
C/C++语言 - 运算符、表达式和语句
C/C++ Table of contents 1. 2. 3. 4. C C++ 5. 6. 7. 1 i // shoe1.c: # include # define ADJUST 7. 64 # define SCALE 0. 325 int main ( void ) { double shoe, foot ; shoe = 9. 0; foot = SCALE * shoe
Microsoft Word - 第3章.doc
Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck
untitled
不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int
3.1 num = 3 ch = 'C' 2
Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:
2 12
SHENZHEN BRILLIANT CRYSTAL TECHNOLOGIC CO.,LTD. The specification for the following models Graphic LCM serial communication control board CB001 PROPOSED BY APPROVED Design Approved TEL:+86-755-29995238
untitled
MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12
untitled
A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (
1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File
51 C 51 51 C C C C C C * 2003-3-30 [email protected] C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test
Microsoft Word - CPE考生使用手冊160524.docx
大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該
但 洋 糖 最 终 乘 船 溯 江 而 上, 再 加 上 民 国 初 年 至 抗 战 前 夕 二 十 余 年 间, 四 川 接 连 不 断 遭 受 水 灾 旱 灾 地 震, 平 均 每 月 爆 发 两 次 军 阀 混 战, 乡 村 遭 受 极 大 破 坏,( 赵 泉 民,2007) 农 村 经 济
原 载 黄 宗 智 主 编 : 中 国 乡 村 研 究 ( 第 八 辑 ), 福 州 : 福 建 教 育 出 版 社 2010 年 4 月 第 一 版, 第 196-241 页 北 京 联 合 大 学 李 安 平 抗 战 时 期 四 川 内 江 农 贷 个 案 研 究 摘 要 : 抗 日 战 争 时 期 四 川 内 江 蔗 农 在 承 受 高 利 贷 盘 剥 的 严 酷 境 遇 中, 利 用 中 国
Microsoft PowerPoint - 20-string-s.pptx
String 1 String/ 1.: char s1[10]; char *s2; char s3[] = "Chan Tai Man"; char s4[20] = "Chan Siu Ming"; char s5[]={'h','e','l','l','o','\0'; 0 1 2 3 4 5 6 7 8 9 10 11 12 s3 C h a n T a i \0 M a n \0 printf
数据结构与算法 - Python基础
Python 教材及课件 课件及作业见网址 xpzhang.me 1 1. Python 2. 3. (list) (tuple) 4. (dict) (set) 5. 6. 7. 2 Python Python 3 Python 4 Python 1, 100, -8080, 0,... 0x 0-9, a-f 0 xff00, 0 xa432bf 5 1.24, 3.14, -9.80,...
全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明
, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1
21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414
C++ 程式設計
C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004
Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco
Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows
科学计算的语言-FORTRAN95
科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造
全台灣路邊攤美食清單.doc
(, (02 8780-0000 ( : (022702-4908 41 ( 2, 800~1000 1000~1500 ; : http://www.map.com.tw/ :,, 90 (022422-3007 159 (50 : ( 62 ( (022456-9281 ( 2 29 2-3 93 128 : ( / / : 93 ( ( 319 (022423-3620 50 1 (022425-0784
untitled
1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override
b1²Ä¤@³¹¼Æ»P§¤¼Ð¨t
第 一 章 數 與 坐 標 系 大 學 聯 考 試 題 與 推 薦 甄 選 試 題 第 一 類 大 學 入 學 甄 試 試 題 評 量 1. 下 列 何 者 是 2 100 除 以 10 的 餘 數? (1) 0 (2) 2 (3) 4 (4) 6 (5) 8 88 年 2. 一 個 正 三 角 形 的 面 積 為 36, 今 截 去 三 個 角 ( 如 右 圖 ), 使 成 為 正 六 邊 形,
( ) A B C D ( ) A B C D A B C D A B C D A 8750 B C 6250 D 5000 A B C D A B C D
1 A B C D A B C D A B C D 1000 1200 900 A B C D ( ) A B C D ( ) A B C D A B C D A B C D 5000 6250 A 8750 B 11250 C 6250 D 5000 A B C D A B C D A B C D 1 200000 400 10 A 1000 B 1600 C 2000 D 2300 1 A B
51 C 51 isp 10 C PCB C C C C KEIL
http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom
新・解きながら学ぶJava
481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --
untitled
Introduction to Programming ( 數 ) Lecture 3 Spring 2005 March 4, 2005 Lecture 2 Outline 數 料 If if 狀 if 2 (Standard Output, stdout): 料. ((Standard Input, stdin): 料. 類 數 數 數 說 printf 見 數 puts 串 數 putchar
列 出 所 有 的 非 負 整 數 解, 係 數 越 大 者 越 先 決 定, 故 先 決 定 z, 再 決 定 y, 最 後 決 定 x, 故 有 + 6 + = 8 ( 種 ) x 0 0 6 8 0 0 6 8 0 6 8 0 y 0 5 0 0 9 8 7 6 5 0 z 0 0 0 0 0
- 乘 法 原 理 基 礎 型. 從 甲 地 至 乙 地 有 5 條 路 可 走, 由 乙 地 至 丙 地 有 條 路 可 走, 由 丙 地 至 丁 地 有 條 路 可 走, 試 問 從 甲 地 經 乙 丙 兩 地 至 丁 地 的 走 法 有 幾 種? 答 60 解 由 乘 法 原 理 知, 有 5 = 60 ( 種 ). 書 店 的 書 架 上 有 種 不 同 的 英 文 書 和 5 種 不 同
## $%& %& ## () #) (( * (+++ () #) #) (+ (+ #) #) ( #, - #)). #))- # ( / / / 0 1 2 0 / $ # ( *. 3. 3 *..# 4 #$ 3 ( 5 ) ### 4 $ # 5, $ ## # 4 $# 5 ( %
# # $ %& $ %# ( $ # ( # $ ( $ $ ( ( % ( $ ( $ ( ( % ( % $ ( $ ( ( $ ( ( ( & ( ( ( $ ( ( % %# ( ( $ ( %# % ## $%& %& ## () #) (( * (+++ () #) #) (+ (+ #) #) ( #, - #)). #))- # ( / / / 0 1 2 0 / $ # ( *.
第六章 数据分析(排列组合、概率和数据描述)
考 纲. 排 列 组 合 第 六 章 数 据 分 析 ( 排 列 组 合 概 率 和 数 据 描 述 ) () 加 法 原 理 乘 法 原 理 () 排 列 与 排 列 数 () 组 合 与 组 合 数. 概 率 () 事 件 及 其 简 单 运 算 () 加 法 公 式 () 乘 法 公 式 () 古 典 概 型 () 贝 努 里 概 型. 数 据 描 述 一 排 列 组 合 ㈠ 知 识 要 点
CC213
: (Ken-Yi Lee), E-mail: [email protected] 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++
IO
1 C/C++ C FILE* fscanf fgets fread fprintf fputs fwrite C++ ifstream ofstream >>
C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40
C C [email protected] C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer
目录
ALTERA_CPLD... 3 11SY_03091... 3 12SY_03091...4....5 21 5 22...8 23..10 24..12 25..13..17 3 1EPM7128SLC.......17 3 2EPM7032SLC.......18 33HT46R47......19..20 41..20 42. 43..26..27 5151DEMO I/O...27 52A/D89C51...28
因 味 V 取 性 又 鸟 U 且 最 大 罗 海 惜 梅 理 春 并 贵 K a t h l ee n S c h w e r d t n er M f l e z S e b a s t i a n C A Fe rs e T 民 伊 ' 国 漳 尤 地 视 峰 州 至 周 期 甚 主 第 应
国 ' 东 极 也 直 前 增 东 道 台 商 才 R od e ric h P t ak 略 论 时 期 国 与 东 南 亚 的 窝 贸 易 * 冯 立 军 已 劳 痢 内 容 提 要 国 与 东 南 亚 的 窝 贸 易 始 于 元 代 代 大 规 模 开 展 的 功 效 被 广 为 颂 扬 了 国 国 内 市 场 窝 的 匮 乏 窝 补 虚 损 代 上 流 社 会 群 体 趋 之 若 鹜 食 窝
C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha
CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc
美鳳吃透透
鳳 中 奇 緣 台 灣 路 邊 攤 推 薦 美 食 ( 依 縣 市 區 域 ) 如 欲 查 詢 更 詳 盡 或 不 清 楚 的 資 料, 請 電 (02) 8780-0000 三 立 觀 眾 服 務 部 查 詢 ( 美 鳳 姐 開 ㄟ 店 : 鳳 廚 (02)2702-4908 台 北 市 復 興 南 路 二 段 41 號 ( 朝 代 飯 店 2 樓, 捷 運 木 柵 線 大 安 站 ) 價 格 :
上海市教育考试院关于印发新修订的
沪 教 考 院 社 考 2012 7 号 上 海 市 教 育 考 试 院 关 于 印 发 上 海 市 高 等 学 校 计 算 机 等 级 考 试 大 纲 (2012 年 修 订 ) 的 通 知 各 有 关 高 校 : 为 进 一 步 加 强 本 市 高 校 计 算 机 基 础 教 学 工 作, 推 进 学 校 更 加 科 学 合 理 地 设 置 计 算 机 基 础 课 程 及 安 排 教 学 内 容,
高 职 计 算 机 类 优 秀 教 材 书 目 * 序 号 书 号 (ISBN) 书 名 作 者 定 价 出 版 / 印 刷 日 期 ** 配 套 资 源 页 码 计 算 机 基 础 课 1 978-7-111-30658-0 计 算 机 应 用 基 础 刘 升 贵 29.00 2012 年 8 月
高 职 计 算 机 类 优 秀 教 材 书 目 * 序 号 书 号 (ISBN) 书 名 作 者 定 价 出 版 / 印 刷 日 期 ** 配 套 资 源 页 码 计 算 机 基 础 课 1 978-7-111-30658-0 计 算 机 应 用 基 础 刘 升 贵 29.00 2012 年 8 月 电 子 教 案 P1 2 978-7-111-27081-2 计 算 机 应 用 基 础 ( 第 2
数 学 高 分 的 展 望 一 管 理 类 联 考 分 析 第 一 篇 大 纲 解 析 篇 编 写 : 孙 华 明 1 综 合 能 力 考 试 时 间 :014 年 1 月 4 日 上 午 8:30~11:30 分 值 分 配 : 数 学 :75 分 逻 辑 :60 分 作 文 :65 分 ; 总
目 录 数 学 高 分 的 展 望... 1 第 一 篇 大 纲 解 析 篇... 1 一 管 理 类 联 考 分 析... 1 二 最 新 大 纲 解 析... 1 三 考 前 复 习 资 料 及 方 法... 第 二 篇 总 结 篇... 4 1 应 用 题 考 点 总 结 与 技 巧 归 纳... 4 代 数 模 块 题 型 归 纳 及 考 点 总 结... 9 3 数 列 模 块 题 型 归
Ps22Pdf
( ) 158,,,,,, ( CIP) /. :, 1996. 12 ISBN 7 302 02353 0... :. F275 CIP ( 96) 20860 : ( :, 100084) : : : 850 1168 1/ 32 : 13. 25 : 344 : 1996 12 1 1996 12 1 : ISBN 7 302 02353 0/ F 130 : 0001 5000 : 16.
Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2
Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790
zt
" # $ % & ( ) " * " ) " % & + ( &, -. % & ( & # $ ( + - " " #$ %%&&& " ()( * %&+# %, %- % #&&# + % #&&# + %./01 ( 2 )&--+ 2 ) 2 -, 3#$4 "#$%& (#)"* # +,-- (#&. / " "#$%& (#)"* # 01&+%$"&2 (#&. / 33 33
E. (A) (B) (C) (D). () () () (A) (B) (C) (D) (E). () () () (A) (B) (C) (D) (E). (A)(B)(C) (D) (E) (A) (B) (C) (D) (E) (A) (B)(C) (D) (E). (A) (B) (C)
. (A) (B) (C) (D) (A) (B) (C)(D)(E). (A) (B) (C) (D) (E) (A) (B) (C) (D). (A) (B) (C) (D) (E) (A) (B) (C) (D) (E). (A) (B) (C) (D) (E). (A) (B) (C) (D) (E). (A) (B) (C) (D) (E) (A) (B) (C) (D) (E). (A)
untitled
0.37kW 250kW D11.7 2009 SINAMICS G120 0.37kW 250kW SINAMICS G120 Answers for industry. SINAMICS G120 0.37kW 250kW SINAMICS G110 D 11.1 0.12 kw 3 kw CA01 MC CA01 MC CD : E20001-K20-C-V2-5D00 141-P90534-09020
CHAPTER VC#
1. 2. 3. 4. CHAPTER 2-1 2-2 2-3 2-4 VC# 2-5 2-6 2-7 2-8 Visual C# 2008 2-1 Visual C# 0~100 (-32768~+32767) 2 4 VC# (Overflow) 2-1 2-2 2-1 2-1.1 2-1 1 10 10!(1 10) 2-3 Visual C# 2008 10! 32767 short( )
