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 |
麻烦帮忙解决一下compile error好吗#include<stdio.h> #include<math.h> #define dis 4.5; void main(){ int n; scanf("%d\n",&n); while(n!=0){ int v[10000],t[10000]; int i,vv,tt,k; double time,s=0; for(i=0;i<n;i++) scanf("%d %d",v[i],t[i]); int T=t[0]; for(;;) if(t[i]<T){ k=i; T=t[k]; vv=v[k]; } for(tt=T;;tt++){ while(s<dis){ double a=ceil((dis-s)/vv/3600); for(i=0;i<n;i++){ if(vv*(tt-T)==v[i]*(tt-t[i])){ k=i; s=s+vv*tt/3600; vv=v[k]; T=tt; } else time=a+T; } } } printf("%d\n",time); scanf("%d\n",&n); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator