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 error#include<stdio.h> float a[10000][2]; float b[10000]; int shijian(int m) { int result; int i; for(i=0;i<m;i++) {if(a[i][1]>=0) b[i]=4.5*3600/a[i][0]+a[i][1]; if(a[i][1]<0) b[i]=0;} return b[m]; } int min(int m) {int i; float t; for(i=0;i<m;i++) { if(b[i]!=0) t=b[i]; if(t>b[i+i]&&b[i+1]!=0) t=b[i+1]; } if(t==(int)t) printf("%d\n",(int)t); else printf("%d\n",(int)t+1); return t; } int main() {int m; int i,j; while(1) { scanf("%d\n",&m); if(m==0) break; for(i=0;i<m;i++) for(j=0;j<2;j++) scanf("%f",&a[i][j]); shijian(m); min(m); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator