superman

聚精会神搞建设 一心一意谋发展
posts - 190, comments - 17, trackbacks - 0, articles - 0
   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

ZOJ 1160 - Biorhythms

Posted on 2008-04-13 14:55 superman 阅读(212) 评论(0)  编辑 收藏 引用 所属分类: ZOJ
 1 /* Accepted 1160 C++ 00:00.23 836K */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int N;
 9     cin >> N;
10     
11     while(N--)
12     {
13         int p, e, i, d, n = 0;
14         while(cin >> p >> e >> i >> d)
15         {
16             if(p == -1 && e == -1 && i == -1 && d == - 1)
17                 break;
18             int x = (p * 5544 + i * 1288 + e * 14421% 21252 - d;
19             while(x <= 0)
20                 x += 21252;
21             cout << "Case " << ++<< ": the next triple peak occurs in "
22                  << x << " days." << endl;
23         }
24         if(N)
25             cout << endl;
26     }
27     
28     return 0;
29 }
30 

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理