1、(完整word)西工大noj答案完整版西北工业大学POJ答案绝对是史上最全版(不止100题哦按首字母排序)1. “1“的传奇2. A+B3. A+B4. AB5. ACKERMAN6. Arithmetic Progressions7. Bee8. Checksum algorithm9. Coin Test10. Dexter need help11. Double12. Easy problem13. Favorite number14. Graveyard15. Hailstone16. Hanoi 17. Houseboat18. Music Composer19. Redistrib
2、ute wealth20. Road trip21. Scoring22. Specialized Numbers23. Sticks24. Sum of Consecutive25. Symmetric Sort26. The Clock27. The Ratio of gainers to losers28. VOL大学乒乓球比赛29. 毕业设计论文打印30. 边沿与内芯的差31. 不会吧,又是A+B32. 不屈的小蜗33. 操场训练34. 插入链表节点35. 插入排序36. 插入字符37. 成绩表计算38. 成绩转换39. 出租车费40. 除法41. 创建与遍历职工链表42. 大数乘法4
3、3. 大数除法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. 恐
4、怖水母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. 五猴分
5、桃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. 字符串排
6、序140. 字符串替换141. 字符串左中右142. 组合数143. 最次方数144. 最大乘积145. 最大整数146. 最小整数147. 最长回文子串148. 左上角149. 左下角1 “1“的传奇#include #include int main() int n,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=qy;if(z=2)s=s+x+zk*(x/10);elses=s
7、+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);return 0;2 A+B#include int doubi(int n,int m) n=n+m; n=n%100; return n;int main() int t,i,a100,n,m; scanf(”%d”,&t); for (i=0;i=(t-1);i+) scanf(”dd”,n,m); ai=doubi(n,m); for (i=0;i=(t-1);i+) printf
8、(%dn”,ai); return 0;3 A+B#include int main()int A,B,sum;scanf(%d%d”,&A,&B);sum=A+B; printf(”%dn”,sum); return 0;4 AB#include stdio.hinclude include string.hint main() char s100,q100; double a,b,c; int n=0,i; scanf(”lf%lf,&a,&b); c=a*b; sprintf(s,%.0lf,c); for(i=0;i=10) sprintf(q,”d”,n); n=0; for(i=0
9、;istrlen(q);i+) n=n+qi-48; printf(”%d”,n); return 0;5 ACKERMAN#include stdio.h#include include math。hint ack(int x,int y) int n; if (x=0) n=y+1; return n; else if (y=0) n=ack(x-1,1); else n=ack(x-1,ack(x,y-1)); return n;int main() int m,b; scanf(d%d,m,b); m=ack(m,b); printf(d”,m); return 0;6 Arithme
10、tic Progressions#include stdio。hinclude stdlib。hinclude =c) break; return s;int main() int a,b,c,d100,i=0,n; while(1) scanf(”%d%dd”,&a,b,&c); if(a=0b=0&c=0) break; di=f(a,b,c); i+; n=i; for(i=0;in;i+) printf(%dn”,di); return 0;7 Bee#include stdio。hinclude stdlib。hint main() int A100,i=0,j,k,female=0
11、,male=1,x; for(;i+)scanf(%d”,Ai);if(Ai=1)break;for(j=0;jinclude stdlib.h#include string.hint main()int i,n,t,j; char s100100; for(i=0;i+)gets(si);if(si0=) break; n=i;for(i=0;in;i+)t=0;for(j=0;jstrlen(si);j+)if(sij=32) t=t;else t=t+(j+1)*(sij64);printf(dn,t); return 0;9 Coin Testinclude include stdli
12、b。hint main() char A100000; int n,i=0,a=0,b=0,j; double x; while(1)scanf(%c,&Ai);if(Ai=n)break;i+;for(j=0;ji;j+)if(Aj=S)printf(”WA”);goto OH;if(Aj=U)a+;if(Aj=D)b+;x=a*1。0/(a+b)*1.0;if(x-0。50。003|x0.50。003)printf(Fail);elseprintf(d/d”,a,a+b);OH:return 0;10 Dexter need helpinclude stdio.hint fun(int a
13、)if(a=1) return 1;elsereturn fun(a/2)+1;int main()int a,b100,i=0,j;while(1) scanf(d,&a); if(a=0)break;bi=fun(a);i+;for(j=0;ji;j+) printf(%dn,bj);return 0;11 Doubleinclude stdio.h#include include int main() int a100,b100,i,j,n,t=0; for(i=0;i+) scanf(”d,ai); if(ai=0) break; n=i; for(i=0;in;i+) bi=2*ai
14、; for(i=0;in;i+) for(j=0;jn;j+) if(ai=bj) t+; printf(”%d,t); return 0;12 Easy problem#include #include stdlib.h#include int main() int N,i,n,j=0; scanf(”d”,N); for(i=2;iN+1;i+) if(N+1)i=0)j+; printf(%d,j/2); return 0;13 Favorite number#include stdio。hinclude string.hdefine MAXNUM 100000int prime_num
15、ber = 0;int prime_listMAXNUM;bool is_primeMAXNUM;int ansMAXNUM + 2;int dpMAXNUM + 2;void set_prime() int i, j; memset(is_prime, 0, sizeof(is_prime)); for (i = 2; i MAXNUM; i+) if (is_primei = 0) prime_listprime_number+ = i; if (i = MAXNUM / i) continue; for (j = i i; j MAXNUM; j+=i) is_primej = 1; i
16、nt main() int i, j, k,o=0,d100; memset(dp, 1, sizeof(dp); set_prime(); ans0 = 0; dp1 = 0; for (i = 1; i dpi + 1) dpi + 1 = dpi + 1; for (j = 0; j MAXNUM / prime_listj) break; k = i * prime_listj; if (dpk = 1 dpk dpi + 1) dpk = dpi + 1; while (scanf(”d%d”, i, &j) = 2 & (i j)) do=ansj ansi 1; o+; for(
17、i=0;io;i+) printf(”%dn”,di);14 Graveyardinclude #include int main() int a100,b100,n,i,j; double s,p,l,t; for(i=0;;i+) scanf(d%d,&ai,bi); if(ai=0bi=0) break; n=i; for(i=0;in;i+) p=10000; if(bi%ai=0)printf(”0.0000n);continue;; t=10000/(double)ai); for(j=1;jai+bi;j+) l=10000/(double)(ai+bi)); l=t-jl; l
18、=fabs(l); if(lp) p=l; s=(ai-1)*p; printf(.4lfn”,s); return 0;15 Hailstone#include stdio。hinclude stdlib.hinclude n) t=m,m=n,n=t; for(i=m;i=n;i+) if(f(i)j) j=f(i); printf( d”,j); return 0;16 Hanoi include stdio.hinclude stdlib。h#define M 70int startM, targeM;long long f(int *p, int k, int fina) if(k=
19、0) return 0; if(pk=fina) return f(p,k-1,fina); return f(p,k-1,6-fina-pk)+(1LL(k1);int main () long long ans; int n; while(scanf(”d,n),n) int i; for(i=1;i=n;i+) scanf(d”,starti); for(i=1;i=n;i+) scanf(”d,targei); int c=n; for(;c=1&startc=targec;c-); if(c=0) printf(0n); continue; int other=6-startc-ta
20、rgec; ans=f(start,c1,other)+f(targe,c1,other)+1; printf(lldn”,ans); return 0;17 Houseboatinclude sqrt(xx+y*y)*sqrt(x*x+yy)pi/2) break; return i;int main() int n,i,a100; float x,y; scanf(”d”,&n); for(i=0;in;i+) scanf(”ff”,x,y); ai=f(x,y); for(i=0;in;i+) printf(”%d dn”,i+1,ai); return 0;18 Music Compo
21、ser19 Redistribute wealth#include include math。hint main() int a1000,b1000,n,i,j,s,sum,t,m,mid,c100,k=0; while(1) scanf(%d”,&n); if(n=0) break; s=0; for(i=1;i=n;i+) scanf(”%d”,&ai); s=s+ai; m=s/n; b1=a1m; b0=0; for(i=2;in;+i) bi=bi1+ai-m; for(i=0;in;i+) for(j=0;j#include stdlib。hinclude math。hint f(
22、int n) int a100,b100,i,s; for(i=0;in;i+) scanf(”%d%d,ai,&bi); s=a0b0; for(i=1;in;i+) s=s+ai(bibi1); return s;int main() int n,c100,i=0; while(1) scanf(d”,&n); if(n=1) break; ci=f(n); i+; n=i; for(i=0;in;i+) printf(”dn,ci); return 0;21 Scoringinclude stdio.hinclude include string。hint main() int i,j,
23、sum,min,c,count,n,a,b; char s150,s250; scanf(”%d”,n); for(i=0;ic|(count=csummin) min=sum; c=count; strcpy(s1,s2); printf(%s %d dn,s1,c,min); return 0;22 Specialized Numbers#include #include stdlib。hint main() int i,n,sum10,sum12,sum16; for(i=2992;i3000;i+) n=i; sum10=0; while(n) sum10+=n10; n/=10; n
24、=i; sum12=0; while(n) sum12+=n12; n/=12; n=i; sum16=0; while(n) sum16+=n16; n/=16; if(sum10=sum12&sum12=sum16) printf(%dn,i); return 0;23 Sticksinclude stdio.hinclude include stdlib.hint len64, n, minlen, get;bool b64;int cmp(const void *a, const void *b) return *(int )a (int )b ? 1 : 1;bool dfs(int
25、 nowlen, int nowget, int cnt) if(cnt = n) return false; if(get = nowget) return true; int i; bool f = false; if(nowlen = 0) f = true; for(i = cnt; i n; i+) if(!bi) if(leni + nowlen = minlen) bi = true; if(dfs(0, nowget+1, nowget)) return true; bi = false; return false; else if(leni + nowlen minlen)
26、bi = true; if(dfs(nowlen+leni, nowget, i+1)) return true; bi = false; if(f) return false; while(i + 1 n & leni = leni+1) i+; return false;int main() int i, tollen; while(scanf(”%d, n), n) tollen = 0; int j = 0, p; for(i = 0; i n; i+) scanf(d, &p); if(p = 50) lenj = p; tollen += lenj; j+; n = j; if(n
27、 = 0) printf(0n); continue; qsort(len, n, sizeof(int), cmp); for(minlen = len0; ; minlen+) if(tollen % minlen) continue; memset(b, 0, sizeof(b)); get = tollen / minlen; if(dfs(0, 0, 0)) printf(%dn”, minlen); break; return 0;24 Sum of Consecutive#include stdio。hinclude stdlib.h#include string。hint len64,n,minlen,get;int b64;int cmp(const void a,const void *b) return (int *)a=n) return 0;