| ||||||||||
| 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 | |||||||||
"Runtime error "是怎么个意思,程序在本地进行正常,但提交不上去??#include<iostream>
#define A 23
#define B 28
#define C 33
#define N 10
using namespace std;
struct recycle
{
int p,e,i,d;
};
int comp(int a,int b,int c,int d)
{
int i;
for(i=0;;i++)
{
if(a+A*i>b&&a+A*i>c)
if((a+A*i-b)%B==0&&(a+A*i-c)%C==0)break;
}
return (a+A*i-d);
}
int main()
{
int i=0,j;
recycle recy[N];
do{
cin>>recy[i].p>>recy[i].e>>recy[i].i>>recy[i].d;
i++;
}while(recy[i-1].p!=-1||recy[i-1].e!=-1||recy[i-1].i!=-1||recy[i-1].d!=-1);
for(j=0;j<i-1;j++)
{
cout<<"Case "
<<j+1
<<": the next triple peak occurs in "
<<comp(recy[j].p,recy[j].e,recy[j].i,recy[j].d)
<<" days."<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator