欢迎来到天天文库
浏览记录
ID:48614146
大小:883.00 KB
页数:11页
时间:2020-01-29
《西工大C语言实验考题及答案.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#includeusingnamespacestd;intmain(){intA[100],n,i;cin>>n;for(i=0;i>A[i];for(i=1;iusingnamespacestd;intmain(){chara,b,c;for(a='X';a<='Z';a++)for(b='X';b<='Z';b++)for(c='X';c<='Z';c++){if(a=='Z'&&b=='Y'&&c=='X
2、')cout<<"A="<usingnamespacestd;intmain(){chara,b,c;for(a='X';a<='Z';a++)for(b='X';b<='Z';b++)for(c='X';c<='Z';c++){if(a=='Z'&&b=='Y'&&c=='X')cout<<"A="<3、tdio.h>#include int main(){ double a; int i=0; scanf("%lf",&a); while(fabs(a)>=1){ a=a/10; i++; } printf("%d",i); return 0;}#includeusingnamespacestd;intmain(){inti,j,k,s,x;for(i=30;i<=100;i++){for(j=1;j<=9;j++)for(k=0;k<=4、9;k++){s=j*1000+j*100+k*10+k;if(j!=k&&s==i*i){cout<#includeusingnamespacestd;intmain(){strings1,s2;cin>>s1;cin>>s2;if(s1>s2)cout<<1<usingnamespacestd;i5、nthb(intn){while(n!=0){if(n%10==8)return1;n=n/10;}}intcb(intn){if(n%8==0)return1;elsereturn0;}intjb(intn){inta,s=0;while(n!=0){a=n%10;s=s+a;n=n/10;}if(s==8)return1;elsereturn0;}intmain(){intn,i;cin>>n;for(i=1;i<=n;i++)if(hb(i)6、7、cb(i)8、9、jb(i))cout<
3、tdio.h>#include int main(){ double a; int i=0; scanf("%lf",&a); while(fabs(a)>=1){ a=a/10; i++; } printf("%d",i); return 0;}#includeusingnamespacestd;intmain(){inti,j,k,s,x;for(i=30;i<=100;i++){for(j=1;j<=9;j++)for(k=0;k<=
4、9;k++){s=j*1000+j*100+k*10+k;if(j!=k&&s==i*i){cout<#includeusingnamespacestd;intmain(){strings1,s2;cin>>s1;cin>>s2;if(s1>s2)cout<<1<usingnamespacestd;i
5、nthb(intn){while(n!=0){if(n%10==8)return1;n=n/10;}}intcb(intn){if(n%8==0)return1;elsereturn0;}intjb(intn){inta,s=0;while(n!=0){a=n%10;s=s+a;n=n/10;}if(s==8)return1;elsereturn0;}intmain(){intn,i;cin>>n;for(i=1;i<=n;i++)if(hb(i)
6、
7、cb(i)
8、
9、jb(i))cout<
此文档下载收益归作者所有