问题描述:http://poj.org/problem?id=1006
注意一下,此题可能会无限WA
#include <iostream>
using namespace std;
int p, e, i, d, t, n=0;
int main()
{
while (cin>>p>>e>>i>>d, p!=-1){
for (n++,t=d+1; t<=d+21252; t++)
if ((t-p)%23==0 && (t-e)%28==0 && (t-i)%33==0) break;
printf("Case %d: the next triple peak occurs in %d days.\n", n, t-d);
}
return 0;
}
目前只能这样过,我写的别的方法都WA
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)