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,j=1,k=1,m=0,n=0,a[1000]={0},x=0; cin>>p>>e>>i>>d; while(p!=-1&&e!=-1&&i!=-1&&d!=-1){ p=p%23; e=e%28; i=i%33; n=e+1; while(n%28!=e){ n=23*j+p; ++j; } m=n; while(m%33!=i){ m=23*28*k+n; ++k; } a[x]=m-d; ++x; j=1; k=1; cin>>p>>e>>i>>d; } for(int h=0;h<x;++h){ a[h]=(a[h]<=21252?a[h]:a[h]-21252); cout<<"Case"<<' '<<h+1<<':'<<' '<<"the next triple peak occurs in"<<' '<<a[h]<<' '<<"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