《C语言考试重点.doc》由会员分享,可在线阅读,更多相关《C语言考试重点.doc(9页珍藏版)》请在三一办公上搜索。
1、C语言考试重点2-4#includevoid main()int a,b,t;printf(请输入两个整数:);scanf(%d%d,&a,&b);if(ab)t=a;a=b;b=t;printf(排序之后的结果为:%d %dn,a,b); 2-9#includevoid main()int i;printf(请输入数字1-7:);scanf(%d,&i);switch(i)case 1:printf(Today is Monday!n);break; case 2:printf(Today is Tuesday!n);break; case 3:printf(Today is Wednesd
2、ay!n);break; case 4:printf(Today is Thursay!n);break; case 5:printf(Today is Friday!n);break; case 6:printf(Today is Saturday!n);break; case 7:printf(Today is Sunday!n);break; default:printf(ninput error!);2-16#includevoid main()int m,n;long fib,fib1=1,fib2=1;printf(请输入n的值:);scanf(%d,&n);printf(%8ld
3、%8ld,fib1,fib2);for(m=3;m=n;m+)fib=fib1+fib2;fib1=fib2;fib2=fib;printf(%8ld,fib);if(m%5=0)printf(n); L6#includevoid main()char ch;int i;ch=A;ch=ch+32;i=ch;printf(%d is %cn,ch,i); printf(%c is %dn,ch,ch); L14#includevoid main()char ch;printf(Input a char:); ch=getchar();putchar(ch+32);L15#includevoid
4、 main()int n;printf(Input a number:); scanf(%d,&n);if(n%2=0)printf(这是一个偶数n); elseprintf(这是一个奇数n); L18#includemain()int i;printf(Input:);scanf(%d,&i);switch(i)case 0:printf(zero);break; case 1:printf(one);break;case 2:printf(two);break; case 3:printf(three);break; case 4:printf(four);break; default:p
5、rintf(other); L22#includemain()int n,sum=0;Loop:printf(Input a number:); scanf(%d,&n);if(n!=-1)if(n%2=0)sum=sum+n;goto Loop;printf(sun=%d,sum);L23#includemain()int i,sum=0;i=1;while(i=100)sum=sum+i;i=i+1;printf(sum=%d,sum);L28#includemain()int n,sum=0;n=0;while(n!=-1)printf(Input a number:);scanf(%d
6、,&n);if(n%2=0)sum=sum+n;printf(sum=%d,sum);L29#includemain()int n;for(n=100;n=200;n+)if(n%3=0)continue;printf(%5d,n);L30#includemain()int i,j;for(i=1;i=9;i+)for(j=1;j=i;j+)printf(%d*%d=%d ,j,i,i*j); printf(n);L31#includemain()int a10,j,temp;for(j=0;j10;j+)待添加的隐藏文字内容2printf(Input a %d,j); scanf(%d,&a
7、j);for(j=0;jaj+1)temp=aj;aj=aj+1;aj+1=temp;for(j=0;j10;j+)printf(%dt,aj);L35-1#includemain()int a,b,c,i;long t,sum;printf(Input a,b,c:);scanf(%d,%d,%d,&a,&b,&c);for(t=1,i=1;i=a;i+)t=t*i;sum=t;for(t=1,i=1;i=b;i+)t=t*i;sum+=t;for(t=1,i=1;i=c;i+)t=t*i;sum+=t;printf(sum=%ld ,sum);L35-2#includelong abc(i
8、nt n)long t;int i;for(t=1,i=1;i=n;i+)t*=i;return(t);main()int a,b,c,i;long abc (int n);printf(Input a,b,c:);scanf(%d,%d,%d,&a,&b,&c);printf(sum=%ld ,abc(a)+abc(b)+abc(c); 29C91AFE4CED1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFEDD1B6C87D1B6C8795AD9C91AFE4CED1B6C8795A
9、D91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF95AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9D1B6C8795AD9C91AFE4CED1B6C8795A1AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFC91FE4CED1D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6CD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4
10、CED1B6C8795AD29C91AF8795AD9C91FE4CED1D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C87D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF5D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFAD9C91FE4CED1B6C8795AD29C91AFB6C8795AD29C91AFB6C8795AD29C91
11、AFD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFFE4CED1B6C8795AD29C91AFC8795AD9C91FE4CED1B6C8795AD29C91AFD1B6C8795AD9C91AFED1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8
12、D1B6C8795AD9C91AFE4CED1D91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFC91FE4CED1D1B6C871AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFC91FE4CED1D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6CD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF8795AD9C91FE4CED
13、1D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C87D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF5D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFAD9C91FE4CED1B6C8795AD29C91AFB6C8795AD29C91AFB6C8795AD29C91AFD1B6C8795AD9C91AFE4CED1B6C8795AD91
14、AFE4CED1B6D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8791AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFC91FE4CED1D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6CD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF8795AD9C91FE4CED1D1B6C8795AD9C91AFE4CED1B6C87
15、95AD91AFE4CED1B6C87D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF5D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFAD9C91FE4CED1B6C8795AD29C91AFB6C8795AD29C91AFB6C8795AD29C91AFD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6D1B6C8795AD9C91AFE4
16、CED1B6C8795AD91AFE4CED1B6C8795AD9C91D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFFE4CED1B6C8795AD29C91AFC8795AD9C91FE4CED1B6C8795AD29C91AFD1B6C8795AD9C91AFED1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8D1B6C8795AD9C91AFE4CED15AD9C91D1B6C8795AD9C91AFE4CED1B6C8795AD91A
17、FE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFFE4CED1B6C8795AD29C91AFC8795AD9C91FE4CED1B6C8795AD29C91AFD1B6C8795AD9C91AFED1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8D1B6C8795AD9C91AFE4CED195AD9C91AFE4CED1B6C8795AD91AFE4CED1B6CD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C9
18、1AF8795AD9C91FE4CED1D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C87D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF5D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFAD9C91FE4CED1B6C8795AD29C91AFB6C8795AD29C91AFB6C8795AD29C91AFD1B6C8795AD9C91
19、AFE4CED1B6C8795AD91AFE4CED1B6D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFFE4CED1B6C8795AD29C91AFC8795AD9C91FE4CED1B6C8795AD29C91AFD1B6C8795AD9C91AFED1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8D1B6C8795AD9C91AF
20、E4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF795AD9C91FE4CED1B6C8795ADD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF29C91AF4CED1B6C8795AD1B6C8795AD9C91AFE4CED1B6C8795AD91AFD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD9C91AFE4C
21、ED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFD1B6C8795AD29C91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C9D1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF1AFD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AFD1BD1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF1B6C8795AD9C91AFE4CED1B6C8795AD91AFE4CED1B6C8795AD9C91FE4CED1B6C8795AD29C91AF4CED1B6C8795AD29C91AFE4CED1B6C8795ADC6F554C62