您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > 西北工业大学noj答案
西北工业大学POJ答案绝对是史上最全版(不止100题哦……按首字母排序)1.“1“的传奇2.A+B3.A+BⅡ4.AB5.ACKERMAN6.ArithmeticProgressions7.Bee8.Checksumalgorithm9.CoinTest10.Dexterneedhelp11.Double12.Easyproblem13.Favoritenumber14.Graveyard15.Hailstone16.HanoiⅡ17.Houseboat18.MusicComposer19.Redistributewealth20.Roadtrip21.Scoring22.SpecializedNumbers23.Sticks24.SumofConsecutive25.SymmetricSort26.TheClock27.TheRatioofgainerstolosers28.VOL大学乒乓球比赛29.毕业设计论文打印30.边沿与内芯的差31.不会吧,又是A+B32.不屈的小蜗33.操场训练34.插入链表节点35.插入排序36.插入字符37.成绩表计算38.成绩转换39.出租车费40.除法41.创建与遍历职工链表42.大数乘法43.大数除法44.大数加法45.单词频次46.迭代求根47.多项式的猜想48.二分查找49.二分求根50.发工资的日子51.方差52.分离单词53.分数拆分54.分数化小数55.分数加减法56.复数57.高低交换58.公园喷水器59.韩信点兵60.行程编码压缩算法61.合并字符串62.猴子分桃63.火车站64.获取指定二进制位65.积分计算66.级数和67.计算A+B68.计算PI69.计算π70.计算成绩71.计算完全数72.检测位图长宽73.检查图像文件格式74.奖金发放75.阶乘合计76.解不等式77.精确幂乘78.恐怖水母79.快速排序80.粒子裂变81.链表动态增长或缩短82.链表节点删除83.两个整数之间所有的素数84.路痴85.冒泡排序86.你会存钱吗87.逆序整数88.排列89.排列分析90.平均值函数91.奇特的分数数列92.求建筑高度93.区间内素数94.三点顺序95.山迪的麻烦96.删除字符97.是该年的第几天98.是该年的第几天?99.数据加密100.搜索字符101.所有素数102.探索合数世纪103.特殊要求的字符串104.特殊整数105.完全数106.王的对抗107.危险的组合108.文件比较109.文章统计110.五猴分桃111.小型数据库112.幸运儿113.幸运数字”7“114.选择排序115.寻找规律116.循环移位117.延伸的卡片118.羊羊聚会119.一维数组”赋值“120.一维数组”加法“121.勇闯天涯122.右上角123.右下角124.圆及圆球等的相关计算125.圆及圆球等相关计算126.程序员添加行号127.找出数字128.找幸运数129.找最大数130.整数位数131.重组字符串132.子序列的和133.子字符串替换134.自然数立方的乐趣135.字符串比较136.字符串复制137.字符串加密编码138.字符串逆序139.字符串排序140.字符串替换141.字符串左中右142.组合数143.最次方数144.最大乘积145.最大整数146.最小整数147.最长回文子串148.左上角149.左下角1.“1“的传奇#includestdio.h#includestdlib.h#includemath.hintmain(){intn,i,j,k=0,x=1,y,z,m,p,q,a,s=0;scanf(%d,&n);m=n;for(i=1;i12;i++){m=m/10;k++;if(m==0)break;}q=n;k=k-1;for(a=1;a=k;a++){x=x*10;}y=q%x;z=q/x;p=q-y;if(z=2)s=s+x+z*k*(x/10);elses=s+z*k*(x/10);for(j=p;j=n;j++){m=j;for(i=1;i12;i++){x=m%10;if(x==1)s++;m=m/10;if(m==0)break;}}printf(%d,s);return0;}2.A+B#includestdio.hintdoubi(intn,intm){n=n+m;n=n%100;returnn;}intmain(){intt,i,a[100],n,m;scanf(%d,&t);for(i=0;i=(t-1);i++){scanf(%d%d,&n,&m);a[i]=doubi(n,m);}for(i=0;i=(t-1);i++)printf(%d\n,a[i]);return0;}3.A+BⅡ#includestdio.hintmain(){intA,B,sum;scanf(%d%d,&A,&B);sum=A+B;printf(%d\n,sum);return0;}4.AB#includestdio.h#includestdlib.h#includestring.hintmain(){chars[100],q[100];doublea,b,c;intn=0,i;scanf(%lf%lf,&a,&b);c=a*b;sprintf(s,%.0lf,c);for(i=0;istrlen(s);i++){n=n+s[i]-48;}while(n=10){sprintf(q,%d,n);n=0;for(i=0;istrlen(q);i++)n=n+q[i]-48;}printf(%d,n);return0;}5.ACKERMAN#includestdio.h#includestdlib.h#includemath.hintack(intx,inty){intn;if(x==0){n=y+1;returnn;}elseif(y==0)n=ack(x-1,1);elsen=ack(x-1,ack(x,y-1));returnn;}intmain(){intm,b;scanf(%d%d,&m,&b);m=ack(m,b);printf(%d,m);return0;}6.ArithmeticProgressions#includestdio.h#includestdlib.h#includemath.hintg(intn){inti;if(n==1)return0;if(n==2)return1;if(n==3)return1;for(i=2;i=sqrt(n);i++)if(n%i==0)return0;return1;}intf(inta,intb,intc){inti=0,s=a-b;if(c==1&&g(a)==1)returna;if(b==0&&g(a)!=1)return-1;while(1){s=s+b;if(g(s))i++;if(i=c)break;}returns;}intmain(){inta,b,c,d[100],i=0,n;while(1){scanf(%d%d%d,&a,&b,&c);if(a==0&&b==0&&c==0)break;d[i]=f(a,b,c);i++;}n=i;for(i=0;in;i++)printf(%d\n,d[i]);return0;}7.Bee#includestdio.h#includestdlib.hintmain(){intA[100],i=0,j,k,female=0,male=1,x;for(;;i++){scanf(%d,&A[i]);if(A[i]==-1)break;}for(j=0;ji;j++){female=0,male=1;for(k=1;kA[j];k++){x=female;female=male;male=x+male+1;}printf(%d%d\n,male,female+male+1);}return0;}8.Checksumalgorithm#includestdio.h#includestdlib.h#includestring.hintmain(){inti,n,t,j;chars[100][100];for(i=0;;i++){gets(s[i]);if(s[i][0]=='#')break;}n=i;for(i=0;in;i++){t=0;for(j=0;jstrlen(s[i]);j++)if(s[i][j]==32)t=t;elset=t+(j+1)*(s[i][j]-64);printf(%d\n,t);}return0;}9.CoinTest#includestdio.h#includestdlib.hintmain(){charA[100000];intn,i=0,a=0,b=0,j;doublex;while(1){scanf(%c,&A[i]);if(A[i]=='\n')break;i++;}for(j=0;ji;j++){if(A[j]=='S'){printf(WA);gotoOH;}if(A[j]=='U')a++;if(A[j]=='D')b++;}x=a*1.0/(a+b)*1.0;if(x-0.50.003||x-0.5-0.003)printf(Fail);elseprintf(%d/%d,a,a+b);OH:return0;}10.Dexterneedhelp#includestdio.hintfun(inta){if(a==1)return1;elsereturnfun(a/2)+1;}intmain(){inta,b[100],i=0,j;while(1){scanf(%d,&a);if(a==0)break;b[i]=fun(a);i++;}for(j=0;ji;j++){printf(%d\n,b[j]);}return0;}11.Double#includestdio.h#includestdlib.h#includemath.hintmain(){inta[100],b[100],i,j,n,t=0;for(i=0;;i++){scanf(%d,&a[i]);if(a[i]==0)break;}n=i;for(i=0;in;i++)b[i]=2*a[i];for(i=0;in;i++)for(j=0;jn;j++)if(a[i]==b[j])t++;printf(%d,t);return0;}12.Easyproblem#includestdio.h#includestdlib.h#includemath.hintmain(){intN,i,n,j=0;scanf(%d,&N);for(i=2;iN+1;i++){if((N+1)%i==0)j++;}printf(%d,j/2);return0;}13.Favoritenumber#includestdio.h#includestring.h#defineMAXNUM100000intprime_number=0;intprime_list[MAXNUM];boolis_prime[MAXNUM];intans[MAXNUM+2];intdp[MAXNUM+2];voidset_prime(){inti,j;memset(is_prime,0,sizeof(is_prime));for(i=2;iMAXNUM;i++){if(is_prime[i]==0){prime_list[prime_number++]=i;if(i=MAXNUM/i)continue;for(j=i*i;jMAXNUM;j+=i){is_prime[j]=1;}}}}intmain(){inti,j,k,o=0,d[100];memset(dp,-1,sizeof(dp));set_prime(
本文标题:西北工业大学noj答案
链接地址:https://www.777doc.com/doc-5952434 .html