level 6
guyf556
楼主
#include<iostream>
using namespace std;
int main()
{
int p,e,i,d;
cin>>p>>e>>i>>d;
for(int k=0;k<2000;k++)
{
p=p+23;
for(int z=0;z<2000;z++)
{
e+=28;
for(int a=0;a<2000;a++)
i+=33;
if((p==e)&&(e==i))
cout<<"Case 1: the next triple peak occurs in "<<p-d<<" days."<<endl;
}
}
return 0;
}
2010年10月29日 10点10分
1
using namespace std;
int main()
{
int p,e,i,d;
cin>>p>>e>>i>>d;
for(int k=0;k<2000;k++)
{
p=p+23;
for(int z=0;z<2000;z++)
{
e+=28;
for(int a=0;a<2000;a++)
i+=33;
if((p==e)&&(e==i))
cout<<"Case 1: the next triple peak occurs in "<<p-d<<" days."<<endl;
}
}
return 0;
}