| ||||||||||
| 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 | |||||||||
请指教!但是您看我的输出部分《》,怎么会OUTPUT LIMIT EXCEED?
#include <iostream.h>
void deal(int p,int e,int i,int d,int t)
{
int m=0;
for(m=0;;m++)
{
if((m-i)%33==0)
break;
}
for(m=m;;m=m+33)
{
if((m-e)%28==0)
break;
}
for(m=m;;m=m+28*33)
{
if((m-p)%23==0)
break;
}
《 if(m<=d)
cout<<"Case "<<t+1<<": the next triple peak occurs in "<<m+21252-d<<" days."<<endl;
else
cout<<"Case "<<t+1<<": the next triple peak occurs in "<<m-d<<" days."<<endl;》
}
void main()
{
int a[50],b[50],c[50],n[50];
int i=0,j=0;
cin>>a[i]>>b[i]>>c[i]>>n[i];
while(a[i]!=-1)
{
i++;
cin>>a[i]>>b[i]>>c[i]>>n[i];
}
for(j=0;j<i;j++)
deal(a[j],b[j],c[j],n[j],j);
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator