码迷,mamicode.com
首页 > 其他好文 > 详细

POJ 1006

时间:2015-06-09 15:40:51      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:

#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    //freopen("acm.acm","r",stdin);
    int p;
    int e;
    int i;
    int d;
    int j;
    j = 0;
    while(cin>>p>>e>>i>>d)
    {
        if(p == -1&& e == -1 && i == -1 && d == -1)
            break;
        e = (5544*p + 14421*e + 1288*i - d)%(21252);
        while(e <= 0)
        {
            e += 21252;
        }
        cout<<"Case "<<++j<<": the next triple peak occurs in "<<e<<" days."<<endl;
    }
}

POJ 1006

标签:

原文地址:http://www.cnblogs.com/gavinsp/p/4563189.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!