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 |
求牛人看一下,这个为什么总是wrong answer#include<iostream.h> #include<math.h> void main(){ int n,k; int *Speed,*setTime,goalTime=0,temp; while(1){ cin>>n; if (n==0)break; Speed=new int[n]; setTime=new int[n]; for(k=0;k<n;k++){ cin>>Speed[k]>>setTime[k]; } for(k=0;k<n;k++){ if(setTime[k]>=0){ temp=int(ceil(setTime[k]+double(4.5)/Speed[k]*3600)); if(goalTime==0)goalTime=temp; else if(goalTime>temp) goalTime=temp; } } cout<<goalTime<<endl; delete Speed; delete setTime; } return; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator