| ||||||||||
| 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#include <iostream>
using namespace std;
#define MAX 10
int main()
{
int count=0;
int i=-1;
int PHY,EMO,INTE,DATE;
int BIO[MAX];
do
{
i++;
cin>>PHY>>EMO>>INTE>>DATE;
BIO[i]=(5544*PHY+14421*EMO+1288*INTE-DATE+21252)%21252;
if(BIO[i]==0)
{
BIO[i]=21252;
}
}while(PHY!=-1);
for(int j=0;j<i;j++)
{
cout <<"Case "<< j++ <<": the next triple peak occurs in " <<BIO[j]<<" 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