CÓïÑÔ»ù´¡Á·Ï°Á·Ï°Ì⸴ϰ(´øÏê½â´ð°¸).doc ÏÂÔر¾ÎÄ

ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2025/1/11 4:35:06ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£

A) auto B) register C) static D) extern

29£®Î´Ö¸¶¨´æ´¢Àà±ðµÄ±äÁ¿£¬ÆäÒþº¬µÄ´æ´¢Àà±ðΪ£¨ A £©¡£ A)auto B)static C)extern D)register 30. ÈôÓÐÒÔÏÂ˵Ã÷Óï¾ä£º struct student { int num; char name[ ]; float score; }stu;

ÔòÏÂÃæµÄÐðÊö²»ÕýÈ·µÄÊÇ: ( D )

A. structÊǽṹÌåÀàÐ͵Ĺؼü×Ö

B. struct student ÊÇÓû§¶¨ÒåµÄ½á¹¹ÌåÀàÐÍ C. num, score¶¼ÊǽṹÌå³ÉÔ±Ãû D. stuÊÇÓû§¶¨ÒåµÄ½á¹¹ÌåÀàÐÍÃû 31.ÈôÓÐÒÔÏÂ˵Ã÷Óï¾ä£º struct date { int year; int month; int day; }brithday;

ÔòÏÂÃæµÄÐðÊö²»ÕýÈ·µÄÊÇ__C___.

A) structÊÇÉùÃ÷½á¹¹ÌåÀàÐÍʱÓõĹؼü×Ö B) struct date ÊÇÓû§¶¨ÒåµÄ½á¹¹ÌåÀàÐÍÃû C) brithdayÊÇÓû§¶¨ÒåµÄ½á¹¹ÌåÀàÐÍÃû D) year,day ¶¼ÊǽṹÌå³ÉÔ±Ãû

32. ÒÔ϶Խṹ±äÁ¿stulÖгÉÔ±ageµÄ·Ç·¨ÒýÓÃÊÇ B struct student { int age£» int num£» }stu1,*p£» p=&stu1£»

A) stu1.age B) student.age C) p->age D) (*p).age 33.ÉèÓÐÈç϶¨Ò壺

struck sk { int a;

Ï°Ìâ

float b; }data; int *p;

ÈôҪʹPÖ¸ÏòdataÖеÄaÓò£¬ÕýÈ·µÄ¸³ÖµÓï¾äÊÇ C A) p=&a;

B) p=data.a; C) p=&data.a; D)*p=data.a;

34.ÉèÓÐÒÔÏÂ˵Ã÷Óï¾ä£º

typedef struct stu { int a; float b; } stutype;

ÔòÏÂÃæÐðÊöÖдíÎóµÄÊÇ£¨ D £©¡£ A¡¢structÊǽṹÀàÐ͵Ĺؼü×Ö

B¡¢struct stuÊÇÓû§¶¨ÒåµÄ½á¹¹ÀàÐÍ C¡¢aºÍb¶¼Êǽṹ³ÉÔ±Ãû

D¡¢stutypeÊÇÓû§¶¨ÒåµÄ½á¹¹Ìå±äÁ¿Ãû 41. ÔÚCÓïÑÔÖУ¬ÒÔ D ×÷Ϊ×Ö·û´®½áÊø±êÖ¾

A)¡¯\\n¡¯ B)¡¯ ¡¯ C) ¡¯0¡¯ D)¡¯\\0¡¯ 42.ÏÂÁÐÊý¾ÝÖÐÊôÓÚ¡°×Ö·û´®³£Á¿¡±µÄÊÇ£¨ A £©¡£

A.¡°a¡± B.{ABC} C.¡®abc\\0¡¯ D.¡®a¡¯ Èô¸É¸ö×Ö·û¹¹³É×Ö·û´®

ÔÚCÓïÑÔÖУ¬Óõ¥ÒýºÅ±êʶ×Ö·û£»ÓÃË«ÒýºÅ±êʶ×Ö·û´® Ñ¡ÏîB£¬C£¬·Ö±ðÓÃ{}ºÍ¡¯¡¯±êʶ×Ö·û´® Ñ¡ÏîD£¬±êʶ×Ö·û¡£

43.ÒÑÖªchar x[]=\Ôò¹ØÓÚÁ½¸öÊý×鳤¶ÈµÄÕýÈ·ÃèÊöÊÇ

B .

A)Ïàͬ B)x´óÓÚy C)xСÓÚy D)ÒÔÉϴ𰸶¼²»¶Ô

CÓïÑÔÖУ¬×Ö·û´®ºóÃæÐèÒªÒ»¸ö½áÊø±ê־λ'\\0'£¬Í¨³£ÏµÍ³»á×Ô¶¯Ìí¼Ó¡£

¶ÔһάÊý×é³õʼ»¯Ê±¿É²ÉÓÃ×Ö·û´®µÄÐÎʽ£¨ÀýÈç±¾ÌâÊý×éx£©£¬Ò²¿É²ÉÓÃ×Ö·û¼¯ºÏµÄÐÎʽ£¨ÀýÈç±¾ÌâÊý×éy£©¡£ÔÚÒÔ×Ö·û´®ÐÎʽ³õʼ»¯Ê±£¬Êý×éx²»¾¡Òª´æ´¢×Ö·û´®ÖеÄ×Ö·û£¬»¹Òª´æ´¢×Ö·û´®ºóµÄ½áÊø±ê־룬Òò´ËÊý×éxµÄ³¤¶ÈΪ6£»ÔÚÒÔ×Ö·û¼¯ºÏÐÎʽ³õʼ»¯Ê±£¬Êý×éy£¬½ö´æ´¢¼¯ºÏÖеÄÔªËØ£¬Òò´ËÊý×éy³¤¶ÈΪ5

Ï°Ìâ

4£®±à³Ì¼ÆËã1£«3£«5¡­£«99µÄÖµ

main()

{ int i, sum = 0;

i=1;

while ( i<100 )

{ sum = sum + i;

I=i+2 ; } printf(\}

5£®´Ó¼üÅÌÊäÈëÒ»¸ö×Ö·û£¬ÅжÏËüÊÇ·ñÊÇÓ¢ÎÄ×Öĸ¡£ #include void main() {char c;

printf(\ c=getchar();

if(c>= ¡®A¡¯ &&c<= ¡®Z¡¯ || c>=¡®a¡¯ &&c<= ¡®z¡¯) printf(\\\n\ else printf(\}

6. ÏÂÃæ³ÌÐòµÄ¹¦ÄÜÊÇÔÚaÊý×éÖвéÕÒÓëxÖµÏàͬµÄÔªËØËùÔÚλÖÃ,ÇëÌî¿Õ¡£ #include void main() { int a[10],i,x;

printf(¡°input 10 integers£º¡±); for(i=0;i<10;i++)

scanf(¡°%d¡±,&a[i]);

printf(¡°input the number you want to find x£º¡±);

scanf(¡°%d¡±, &x );

for(i=0;i<10;i++)

if( x==a[i] ) break;

if( i<10 )

printf(¡°the pos of x is£º%d\\n¡±,i);

else printf(¡°can not find x£¡\\n¡±);

Ï°Ìâ

}

7£®³ÌÐò¶ÁÈë20¸öÕûÊý£¬Í³¼Æ·Ç¸ºÊý¸öÊý£¬²¢¼ÆËã·Ç¸ºÊýÖ®ºÍ¡£ #include main( )

{ int i, a[20], s, count; s=count=0;

for(i=0; i<20; i++) scanf(¡°%d¡±, &a[i] ); for(i=0; i<20; i++)

{ if( a[i]<0 ) continue ; s+=a[i] ; count++; }

printf(¡°s=%d\\t count=%d\\n¡±, s, count¡±); }

8. ÊäÈëÒ»¸öÕýÕûÊýn (1

#include int main(void){

int i, index, k, n, temp;

/* ¶¨Òå1¸öÊý×éa£¬ËüÓÐ10¸öÕûÐÍÔªËØ*/ printf(¡°Enter n: \

printf(¡°Enter %d integers: \ n); for(i = 0; i < n; i++) scanf(\

for(k = 0; k < n-1; k++){ /* ¶Ôn¸öÊýÅÅÐò */ index = k;

for( )

if( ) index = i; }

printf(\

for(i = 0; i < n; i++) /* Êä³ön¸öÊý×éÔªËصÄÖµ */ return 0;}

Ï°Ìâ

Ò»¡¢ ³ÌÐò¸Ä´í

Ò»¡¢ ÏÂÃæÿ¸ö³ÌÐòµÄ»®Ïß´¦ÓÐÓï·¨»òÂß¼­´íÎó£¬ÇëÕÒ³ö²¢¸ÄÕý£¬Ê¹ÆäµÃµ½·ûºÏÌâÒâµÄÖ´Ðнá¹û¡£ £±£®Çó1?2?3?4???n main()

{ long int sum; / /Èô¶¨Òå±äÁ¿µÄÓï¾äÓдíÎ󣬳£¼û¿¼µãÓÐÁ½¸ö£º£¨1£©±äÁ¿µÄÀàÐÍ£¬£¨2£©ÔÚ¶¨ÒåÓÃÓÚ´æ·ÅÔËËã½á¹ûµÄ±äÁ¿Ê±£¬Ò»¶¨Òª¸³³õÖµ¡£Ò»°ã¸³Öµ0»òÕßÑ­»·³õÖµ¡£

int n,i=1;

scanf(\//ÈôscanfÓï¾äÓдíÎ󣬳£¼û¿¼µãÓÐÁ½¸ö£º£¨1£©¸ñʽÉùÃ÷·ûºÅÒªÓëºóÃæ

Óû¸³ÖµµÄ±äÁ¿µÄÀàÐÍÒ»Ö£¬´ËÌâ%dÓënµÄÀàÐÍintÒ»Ö£¨Ïê¼ûp69-78£©£»£¨2£©±äÁ¿µÄÇ°ÃæÒªÓеØÖ··ûºÅ&

printf(¡°\\n¡±);

while(i

ÖÕֵΪn-1, ÓÉÓÚÇÒi³õֵΪ1£¬Òò´ËÒ»¹²Äܹ»Ñ­»·n-1´Î¡£±ÈÒªÇóÉÙÁË1´Î£¬Òò´ËÓ¦¸ÄΪi<=n »òÕßi

{ sum=sum*i; // Èô²»Îªsum¸³³õÖµ£¬Ôò´Ë´¦ÎÞ·¨¼ÆËãsum*i¡£ i++; }

printf(\ //ÈôprintfÓï¾äÓдíÎ󣬳£¼û¿¼µãÓÐ1¸ö£º¸ñʽÉùÃ÷·ûºÅÒªÓë

ºóÃæÓûÊä³öµÄ±äÁ¿µÄÀàÐÍÒ»Ö£¬´ËÌâ%dÓësumµÄÀàÐÍlong int²»Ò»Ö£¬Ó¦¸ÄΪ%ld£¨Ïê¼ûp69-78£©£»

}

sumÓ¦³õʼ»¯ ¼´¼ÓÈësum=1 µÚËÄÐиÄΪ£ºscanf(¡°%d¡±,&n);

µÚÁùÐиÄΪ£ºwhile(i<=n)»òÕß while(i

2£®ÇóÒ»¸öÊý×éÖÐ×î´óÖµ¼°Æäϱꡣ

main( )

{ int max,j,m; int a[5];

for(j=1;j<=5;j++) // j=1Ϊѭ»·±äÁ¿j¸³³õֵΪ1£¬Í¬Ê±ÓÃj×÷ΪÊý×ÖÔªËصÄÂß¼­

µØַϱꡣÒò´ËÊä³öµÄʱºòÖ»ÄÜ´Óa[1]¿ªÊ¼Êä³ö£¬ÎÞ·¨Êä³öa[0].Òò´ËÓ¦½«j¸³³õÖµ0£¬ÏàÓ¦µÄÑ­»·Ìõ¼þ¸ÄΪj<5»òÕßj<=4ÓÃÓÚ¿ØÖÆÑ­»·Ö´ÐÐ5´Î

scanf(¡°%d¡±,a); //ÈôscanfÓï¾äÓдíÎ󣬳£¼û¿¼µãÓÐÁ½¸ö£º£¨1£©¸ñʽÉùÃ÷·ûºÅÒªÓë

ºóÃæÓû¸³ÖµµÄ±äÁ¿µÄÀàÐÍÒ»Ö£¬´ËÌâ%dÓëaµÄÀàÐÍintÒ»Ö£¨Ïê¼ûp69-78£©£»£¨2£©±äÁ¿µÄÇ°ÃæÒªÓеØÖ··ûºÅ&

max=a[0];

for(j=1;j<=5;j++) //ÐÞ¸Ä˼·ÓëÉÏÒ»¸öforÓï¾äͬ

if(ma ϱê´æ

ÔÚ

Ï°Ìâ