`
EmmaZhao
  • 浏览: 32284 次
  • 性别: Icon_minigender_2
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

POJ1006

 
阅读更多
#include<iostream>
using namespace std;

int main()
{
	int p,e,i,d,num = 1;
	cin>>p>>e>>i>>d;
	while((p!=-1) || (e!=-1) || (i!=-1) || (d!=-1)){
		while((p!=e) || (p!=i)){
			if(p<e){
				if(p<i){
					p+=23;
				}else i+=33;
			}
			else{
				if(e<i) e+=28;
				else i+=33;
			}
		
		}
		int days = (21252+p-d)%21252;
		if(days == 0) days = 21252;
		cout<<"Case " << num <<": the next triple peak occurs in " << days << " days."<<endl;
		num++;
		cin>>p>>e>>i>>d;
	}
	return 0;
}
分享到:
评论

相关推荐

    POJ 1006 源代码——中国剩余定理分析

    POJ 1006 源代码——中国剩余定理分析POJ 1006 源代码——中国剩余定理分析POJ 1006 源代码——中国剩余定理分析

    Poj1006题目ac代码

    解决poj1006问题

    POJ1006-Biorhythms【中国剩余定理】

    北大POJ1006-Biorhythms【中国剩余定理】 解题报告+AC代码

    poj 1006 Biorhythms 生理周期

    Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53539 Accepted: 15282 Description Some people believe that there are three cycles in a person's life that start the day he or ...

    ABC.zip_2262_ABC

    POJ 1006 1017 1028 1799 2262源码 简单的算法

    poj ac题目代码

    1000 1003 1004 1005 1006 1008 1012 1028 1036 1045 1046 1047 1087 1163 1183 1207 1218 1247 1269 1298 1306 1316 1326 1331 1338 1401 1423 1450 1455 1477 1488 1503 1504 1517 1519 1528 1543 1547 1552 1555 ...

    poj100题解。具体题号见说明

    1000 1002 1003 1004 1005 1006 1007 1008 1011 1012 1013 1019 1028 1045 1046 1068 1080 1088 1163 1207 1218 1256 1298 1299 1316 1326 1401 1455 1477 1488 1503 1504 1517 1519 1547 1552 1565 1579 1607 1656 ...

    poj135道题的代码

    1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1011 1012 1013 1014 1018 1019 1028 1032 1040 1042 1045 1046 1047 1050 1056 1061 1062 1063 1065 1067 1068 1083 1088 1102 1113 1118 1126 1141 1142 1157 ...

    acm poj 源代码

    1001 1002 1003 1004 1005 1006 1007 1008 1011 1012 1013 1014 1015 1017 1018 1019 1028 1032 1042 1046 1050 1061 1065 1066 1067 1077 1080 1083 1088 1094 1111 1125 1135 1141 1157 1160 1161 1163 1166 1170 ...

    poj pku 解题报告

    1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1011 1012 1013 1014 1015 1017 1018 1019 1028 1032 1035 1040 1042 1045 1046 1047 1050 1056 1061 1062 1063 1065 1067 1068 1080 1083 1088 1089 1091 1094 ...

    PKU源码。。。。。

    PKU,POJ共301题源代码。1001 1002 1003 1004 1005 1006 1007 1008 1011 1012 1013 1014 1015 1017 1018 1019 1028 1032 1042 1046 1050 1061 1065

    leetcode中国-Homo-sapiens-ACM-Learning:智人-ACM-学习

    1006 1007 专题分类 (一)简单搜索 ID Problem C++ Source 1 HDU 2553 (精简版) 2 HDU 1312 3 POJ 3984 4 POJ 2251 5 POJ 3278 6 POJ 3279 7 ZOJ 1002 8 POJ 1321 9 HDU 1241 (二)树 ID Problem C++ Source 1 ...

    leetcode中国-ACM-Learning:ACM竞赛中关于算法的代码

    1006 1007 专题分类 (一)简单搜索 ID Problem C++ Source 1 HDU 2553 (精简版) 2 HDU 1312 3 POJ 3984 4 POJ 2251 5 POJ 3278 6 POJ 3279 7 ZOJ 1002 8 POJ 1321 9 HDU 1241 (二)树 ID Problem C++ Source 1 ...

    acm_problems:刷题!!!

    #POJ 题集 数论 欧几里得/拓展欧几里得算法 1006 1061 搜索 普通搜索 1062, 1088, 2386 剪枝优化 1011 动态规划 背包 1014 高精度 加减乘除 1001 巧妙处理 思维处理 1852 模拟 1017 简单题 水题 1004 1007 1008 枚举...

Global site tag (gtag.js) - Google Analytics