| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
谁能帮帮忙,看一下错在那?测试数据都行,谢谢#include<iostream.h>
#include<stdlib.h>
void main()
{
int in[4],j,count=0;
do{
j=0;
for(long int i=0;i<4;i++)
{
cin>>in[i];
if(in[i]==-1)
j++;
}
if(j==4)exit(0);
count++;
long int res,temp1,temp2,temp3,temp4;
for(i=1;;i++)
{
temp1=(10*i+in[2]-in[0])%23;
temp2=(5*i+in[2]-in[1])%28;
temp3=i+(10*i+in[2]-in[0])/23;
temp4=i+(5*i+in[2]-in[1])/28;
res=i*33+in[2]-in[3];
if(temp1==0&&temp2==0&&res>0&&temp3>0&&temp4>0)
{
break;
}
}
cout<<"Case "<<count<<": the next triple peak occurs in "
<<res<<" days."<<endl;
}while(1==1);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator