ZOJ 1160 历法水题
2011-05-13 21:11
267 查看
题目连接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=160
可以直接暴力
可以直接暴力
#include<stdio.h> int main() { int d,p,i,e,x,t; int temp1,temp2,temp3; scanf("%d",&t); while(t--) { int cnt=1; while(scanf("%d%d%d%d",&p,&e,&i,&d)!=EOF) { if(p==-1&&e==-1&&i==-1&&d==-1) break; for(x=21252;x>=0;x--) { temp1=(x+d-p)%23; temp2=(x+d-e)%28; temp3=(x+d-i)%33; if(temp1==0&&temp2==0&&temp3==0) { printf("Case %d: the next triple peak occurs in %d days./n",cnt++,x); break; } } } if(t) printf("/n"); } return 0; }
相关文章推荐
- UVALive5389 UVA414 POJ1493 ZOJ1339 Machined Surfaces【输入输出+水题】
- zoj 3827 Information Entropy(水题)
- ZOJ 3207 80ers' Memory(水题)
- [ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]
- zoj 1115 水题+找规律
- zoj 2443 水题。。。
- zoj1796水题
- UVALive2287 POJ1047 HDU1313 ZOJ1073 Round and Round We Go【大数+数学计算+水题】
- hdu 1045 || zoj 1002 Fire Net(搜索:DFS+水题)
- ZOJ 3708 Density of Power Network (水题)
- HDU1321 ZOJ1295 Reverse Text【水题】
- POJ1922 HDU1445 ZOJ2229 Ride to School【最值+水题】
- [ACM] ZOJ 3819 Average Score (水题)
- ZOJ - 2421 Recaman's Sequence(打表水题)
- [ZOJ]1048-水题一枚-注意数据类型转换的技巧
- zoj 3210 A Stack or A Queue? (数据结构水题)
- zoj1904水题
- Magic Number - ZOJ 3622 水题
- 【数论】 HDOJ 1370 && POJ 1006 && ZOJ 1160 Biorhythms
- ZOJ 3947 Very Happy Great BG(水题)