| ||||||||||
| 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 | |||||||||
求救!WA了很多次但检查不出来有神马错误#include<iostream>
using namespace std;
int main()
{
int *p,*e,*i,*d,p1,e1,i1,d1,j=0,k;
p=new int[100];
e=new int[100];
i=new int[100];
d=new int[100];
cin>>p1>>e1>>i1>>d1;
while(p1+1)
{
p[j]=p1%23;
e[j]=e1%28;
i[j]=i1%33;
d[j]=d1;
j++;
cin>>p1>>e1>>i1>>d1;
}
for(k=0;k<j;k++)
{
while(p[k]!=e[k])
{
if(p[k]>e[k])
e[k]+=28;
else p[k]+=23;
}
while(e[k]!=i[k])
{
if(e[k]>i[k])
i[k]+=33;
else e[k]+=644;
}
cout<<"Case "<<<k+1<<": the next triple peak occurs in "<<(i[k]>d[k]?i[k]-d[k]:i[k]-d[k]+21252)<<" days."<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator