西工大NOJ内容标准答案完全版.doc
《西工大NOJ内容标准答案完全版.doc》由会员分享,可在线阅读,更多相关《西工大NOJ内容标准答案完全版.doc(113页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、,.#includeintmain()inta,b,sum;scanf(%d%d,&a,&b);sum=a+b;printf(%dn,sum);return0;#include#definePI3.1415926intmain()doubler,h,l,s,sq,vq,vz;scanf(%lf%lf,&r,&h);l=2*PI*r;s=PI*r*r;sq=4*PI*r*r;vq=PI*r*r*r*4/3;vz=PI*r*r*h;printf(%.2lfn%.2lfn%.2lfn%.2lfn%.2lfn,l,s,sq,vq,vz);return0;#includeintmain()doublem
2、a,eng,c,sum,ave;scanf(%lf%lf%lf,&ma,&eng,&c);sum=ma+eng+c;ave=sum/3;printf(%lfn%lfn,sum,ave);return0;#includeintmain()inta,b,c,m;scanf(%d%d%d,&a,&b,&c);if(ab)m=a;elsem=b;if(mc)m=c;printf(%d,m);return0;#includeintmain()intn;scanf(%d,&n);if(1000n10000)&(n/1000=n%10)&(n/100%10=n/10%10)printf(yesn);else
3、if(100n=1000)&(n/100=n%10)printf(yesn);elseif(10n=100)&(n/10=n%10)printf(yesn);elseif(0n=10)printf(yesn);elseprintf(non);return0;#includeintmain()doublel,bon;scanf(%lf,&l);if(l=10)bon=l*0.1;elseif(l20)bon=1+(l-10)*0.075;elseif(l40)bon=1.75+(l-20)*0.05;elseif(l60)bon=2.75+(l-40)*0.03;elseif(l100)bon=
4、3.35+(l-60)*0.015;elsebon=3.95+(l-100)*0.01;printf(%lfn,bon);return0;#includeintmain()doubled,m;scanf(%lf,&d);if(d=2)m=7;elseif(d=15)if(d-2=(int)(d-2)m=7+(d-2)*1.5;elsem=7+(int)(d-2)+1)*1.5;elseif(d-15=(int)(d-15)m=26.5+(d-15)*2.1;elsem=26.5+(int)(d-15)+1)*2.1;printf(%lfn,m);return0;#includeintmain(
5、)inty,m,d,Days,sum;scanf(%d-%d-%d,&y,&m,&d);if(y%4=0&y%100!=0)|(y%400=0)Days=29;elseDays=28;switch(m)case1:sum=d;break;case2:sum=31+d;break;case3:sum=31+Days+d;break;case4:sum=62+Days+d;break;case5:sum=92+Days+d;break;case6:sum=123+Days+d;break;case7:sum=153+Days+d;break;case8:sum=184+Days+d;break;c
6、ase9:sum=215+Days+d;break;case10:sum=245+Days+d;break;case11:sum=276+Days+d;break;case12:sum=307+Days+d;break;printf(%dn,sum);return0;#includeintmain()inti;scanf(%d,&i);if(i=90)printf(An);elseif(i=80)printf(Bn);elseif(i=70)printf(Cn);elseif(i=60)printf(Dn);elseprintf(En);return0;#includeintmain()dou
7、blex,y;scanf(%lf,%lf,&x,&y);if(x-2)*(x-2)+(y-2)*(y-2)=1)printf(10);elseif(x-2)*(x-2)+(y+2)*(y+2)=1)printf(10);elseif(x+2)*(x+2)+(y-2)*(y-2)=1)printf(10);elseif(x+2)*(x+2)+(y+2)*(y+2)=1)printf(10);elseprintf(0);return0;#includeintmain()doublel,x,r;scanf(%lf%lf,&l,&r);while(2*l*l*l-4*l*l+3*l-6)!=0&(2*
8、r*r*r-4*r*r+3*r-6)!=0)x=(l+r)/2;if(2*l*l*l-4*l*l+3*l-6)*(2*x*x*x-4*x*x+3*x-6)=0)r=x;elsel=x;if(2*l*l*l-4*l*l+3*l-6=0)printf(%.2lf,l);elseprintf(%.2lf,r);return0;#include#includeintmain()inti=800,t=2,cnt=0,sum=0;doublee=-1;while(i=500)while(t=i-1)if(i%t=0)break;t+;if(t=i)e=pow(-1,cnt),sum=sum+e*i,cnt
9、+;i-;t=2;printf(%d%d,cnt,sum);return0;#include#includeintmain()inta=1;doubleb=1,pi=0,c=1;while(fabs(c)=1e-6)pi=pi+c,b=b+2,a=-a,c=a/b;pi=pi*4;printf(%lfn,pi);return0;#includeintmain()inta1=1,a2=1,n=2,sum=2,t;while(sum=100)t=a1;a1=a2;a2=t+2*a2;sum=sum+a2;n+;printf(%dn,n-1);while(sum=1000)t=a1;a1=a2;a2
10、=t+2*a2;sum=sum+a2;n+;printf(%dn,n-1);while(sum=10000)t=a1;a1=a2;a2=t+2*a2;sum=sum+a2;n+;printf(%dn,n-1);#includeintmain()intx,a,s,n=1;scanf(%d%d,&x,&a);s=x;if(a!=0)for(;n=1000)s=s/100%10*100+s/10%10*10+s%10;printf(%dn,s);return0;#includeintmain()intm,n,s;scanf(%d,&n);s=n*n*n;printf(%d*%d*%d=%d=,n,n
11、,n,s);for(m=1;s!=n*m;m+);if(n%2=1)for(s=-n/2;sn/2;s+)printf(%d+,m+2*s);printf(%d,m+n/2*2);elsefor(s=-n/2;sn/2-1;s+)printf(%d+,m+s*2+1);printf(%d,m+(n/2-1)*2+1);return0;#includeintmain()chara,b,c,x,y,z;a=A,b=B,c=C,x=X,y=Y,z=Z;printf(%c=%cn,a,z);printf(%c=%cn,b,x);printf(%c=%cn,c,y);return0;#includein
12、tmain()inta,b,t;scanf(%d%d,&a,&b);if(ab)t=a,a=b,b=t;for(;ab;a+)for(t=2;ta;t+)if(a%t=0)break;if(t=a)printf(%d,a);return0;#includeintmain()intn=1;doublea1=1,a2=2,a3,sum=2;while(n=19)a3=a1+a2;sum=sum+a3/a2;a1=a2;a2=a3;n+;printf(%lfn,sum);return0;#include#includeintmain()doublea;intn=0;scanf(%lf,&a);a=f
13、abs(a);if(a1)a=a/10;n+;printf(%dn,n);return0;#includeintmain()inta=1,b=0,t,m,n=0;scanf(%d,&t);while(nt)m=b;b=3*a+2*b;a=m;n+;printf(%d%d,a,b);return0;#include#includeintmain()intn;intf(intn);scanf(%d,&n);printf(%dn,f(n);intf(intn)inta;if(n=1|n=2)a=0;elseif(n=3)a=1;elseif(n=4)a=3;elsea=f(n-1)*2+pow(2,
14、n-4)-f(n-4);returna;#includeintmain()intn,x=1234,y=1,a,b,c,d,e,f,g,h,i,j;scanf(%d,&n);for(;x49383&y98765;x+)y=x*n;a=x/10000%10;b=x/1000%10;c=x/100%10;d=x/10%10;e=x%10;f=y/10000%10;g=y/1000%10;h=y/100%10;i=y/10%10;j=y%10;if(a=b|a=c|a=d|a=e|a=f|a=g|a=h|a=i|a=j)continue;if(b=c|b=d|b=e|b=f|b=g|b=h|b=i|b
15、=j)continue;if(c=d|c=e|c=f|c=g|c=h|c=i|c=j)continue;if(d=e|d=f|d=g|d=h|d=i|d=j)continue;if(e=f|e=g|e=h|e=i|e=j)continue;if(f=g|f=h|f=i|f=j)continue;if(g=h|g=i|g=j)continue;if(h=i|h=j)continue;if(i=j)continue;printf(%05d/%05d=%dn,y,x,n);return0;#include#include#includeintmain()intm,n,i;doublex,s=0;sc
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 西工大 noj 内容 标准答案 完全 完整 彻底
限制150内