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> #include <math.h> void main () { int n,a[10001][2],i,j,b[10001],m; scanf ("%d",&n); while (n) { for (i=0;i<n;i++) scanf ("%d %d",&a[i][0],&a[i][1]); for (i=0;i<n;i++) { if (a[i][1]=0) b[i]=(int)ceil((double)(16200.0/(double)a[i][0])+a[i][1]); else b[i]=0; for (i=1;i<n;i++) { for (j=0;j<n-i;i++) { if (b[j]>b[j+1]) { m=b[j]; b[j]=b[j+1]; b[j+1]=m; } } } for (i=0;i<n;i++) { if (b[i]>0) { printf ("%d\n",b[i]); break; } } m=0; scanf ("%d",&n); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator