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 |
为什么错的?#include<stdio.h> typedef struct ad { int x; int start; double time; }Q; Q a[100008]; int main() { int i,j,n; double min,k; int m; while(scanf("%d",&n)!=EOF&&n!=0) { for(i=0;i<n;i++) { scanf("%d %d",&a[i].x,&a[i].start); if(a[i].start>=0) { a[i].time=a[i].start*1.0+4500*3.6/a[i].x; } } i=0; while(a[i].start<0) i++; min=a[i].time; for(j=i+1;j<n;j++) { if(a[j].start>0&&a[j].time<min) min=a[j].time; } m=(int)min; k=(double)m; if(min==k) printf("%d\n",m); else printf("%d\n",m+1); } return 0; } 我觉得这个代码没有问题啊!哪位朋友帮忙看看啊!谢谢啦! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator