/* ¢Ú */
}
¢Ù A) 0 B) 1 C) 2 D) 3 ¢Ú A) 0 B) 1 C) 2 D) 3
¡¾7.50¡¿ ÔĶÁÏÂÁгÌÐò£¬Ñ¡Ôñ³ÌÐòµÄÔËÐнá¹û¡£ #define FMT ¡°%X\\n¡± #include
£û static int a[ ][4] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
printf (FMT, a[2][2]); /* ¢Ù */ printf (FMT, *(*(a+1)+1) ); /* ¢Ú */ }
¢Ù A) 9 B) A C) B D) Ç°ÃæÈý¸ö´ð°¸¾ùÊÇ´íÎóµÄ ¢Ú A) 6 B) 7 C) 8 D) Ç°ÃæÈý¸ö´ð°¸¾ùÊÇ´íÎóµÄ ¡¾7.51¡¿Ñ¡ÔñÏÂÁгÌÐòµÄÔËÐнá¹û¡£ #include
{ int n[3][3], i, j;
for ( i=0; i<3; i++) for ( j=0; j<3; i++ ) n[i][j] = i+j; for ( i=0; i<2; i++ ) for ( j=0; j<2; j++ ) n[i+1][j+1] += n[i][j]; printf (¡°%d\\n¡±,n[i][j];
}
A) 14 B) 0 C) 6 D)²»È·¶¨
¡¾7.52¡¿ÔĶÁÏÂÁгÌÐò£¬Ñ¡Ôñ³ÌÐòµÄÔËÐнá¹û¡£ main ( )
{ int a[6][6], i, j;
for ( i=1; i<6; i++ ) for ( j=1; j<6; j++ ) a[i][j] = (i/j)*(j/i); for ( i=1; i<6; i++ ) { for ( j=1; j<6; j++ ) printf (¡°-¡±, a[i][j]); printf (¡°\\n¡±); }
}
A) 1 1 1 1 1 B) 0 0 0 0 1
1 1 1 1 1 0 0 0 1 0 1 1 1 1 1 0 0 1 0 0 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 0
C) 1 0 0 0 0 D) 1 0 0 0 1
0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 1
¡¾7.53¡¿ÔĶÁÏÂÁгÌÐò£¬Ñ¡Ôñ³ÌÐòµÄÔËÐнá¹û¡£ main ( ) { int a[6],i;
for ( i=0; i<6; i++ ) { a[i] = 9*(i-2+4*(i>3)) % 5; printf(¡°-¡±,a[i]); }
}
A) -3-4 0 4 0 4 B) -3-4 0 4 0 3 C) -3-4 0 4 4 3 D) -3-4 0 4 4 0
¡¾7.54¡¿ÔĶÁÏÂÁгÌÐò£¬Ñ¡Ôñ³ÌÐòµÄÔËÐнá¹û¡£ #include
{ int i, k, a[10], p[3];
k=5;
for ( i=0; i<10; i++ ) a[i] = i; 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 );
}
A) 20 B) 21 C) 22 D) 23
¡¾7.55¡¿ÔĶÁ³ÌÐò£¬Ð´³öÖ´Ðнá¹û¡£
#include
scanf (¡°%s¡±, str); printf (¡°%s¡±, str);
}
ÔËÐгÌÐò£¬ÊäÈ룺Fortran Language
¡¾7.56¡¿ÔĶÁ³ÌÐò£¬Ð´³öÖ´Ðнá¹û¡£ #include ¡°stdio.h¡± main ( ) { char str[30]; gets (str); printf (¡°%s\\n¡±, str); {
ÔËÐгÌÐò£¬ÊäÈ룺Fortran Language
¡¾7.57¡¿ÔĶÁ³ÌÐò£¬Ð´³öÖ´Ðнá¹û¡£ #include ¡°stdio.h¡± func ( int b[ ] ) { int j;
for (j=0; j<4; j++)
b[j]=j;
} main ( ) { int a[4], i; func (a);
for ( i=0; i<4; j++) printf ( ¡°%d¡±, a[i]); }
¡¾7.58¡¿Ð´³ö³ÌÐòµÄÔËÐнá¹û¡£ #include
{ char str[100] = ¡°How do you do¡±; strcopy ( str + strlen(str)/2,¡±es she¡±); printf (¡°%s\\n¡±,str);
}
¡¾7.59¡¿ÔËÐÐÏÂÃæµÄ³ÌÐò£¬Èç¹û´Ó¼üÅÌÉÏÊäÈë×Ö·û´®¡°qwerty¡±ºÍ×Ö·û´®¡°abcd¡°£¬Çëд³ö³ÌÐòµÄÔËÐнá¹û¡£
#include
while ( a[num]!=?\\0? ) num++; while (b[n]) { a[num]=b[n];
num++; n++; }
return ( num );
} main ( )
{ char str1[81], str2[81]; gets (str1); gets (str2);
printf (¡°%d\\n¡±, strle (str1, str2 ) ); }
7.3 ³ÌÐòÑ¡ÔñÌî¿Õ
¡¾7.60¡¿ÏÂÃæ³ÌÐòÊä³öÁ½¸ö×Ö·û´®ÖжÔӦλÖÃÏàͬµÄ×Ö·û¡£ÇëÑ¡ÔñÌî¿Õ¡£ #include
while ( x[i]!=?\\0? && y[i]!=?\\0? ) if ( x[i]= =y[i] ) printf(¡°%c¡±, ¢Ù ); else i++;
}
A) x[i++] B) y[++i] C) x[i] D) y[i]
¡¾7.61¡¿ÓÐÒÑ°´ÉýÐòÅźÃÐòµÄ×Ö·û´®a£¬ÏÂÃæµÄ³ÌÐòÊǽ«×Ö·û´®sÖеÄÿ¸ö×Ö·û°´ÉýÐòµÄ¹æÔò²åµ½Êý×éaÖС£
#include
{ char a[20] = ¡°cehiknqtw¡±; char s[ ] = ¡°fbla¡±;