| ||||||||||
| 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 | |||||||||
Re:实在不行了 有哪位好心的人能帮忙看看??In Reply To:实在不行了 有哪位好心的人能帮忙看看?? Posted by:6382468 at 2004-12-30 13:39:45 > #include<stdio.h>
> #include<math.h>
> void main(){
> int i,j,p;
> long N;
> int a[10001][3];
> scanf("%d",&N);
> while(N!=0){
> for(i=1;i<=N;i++)
> scanf("%d %d",&a[i][0],&a[i][1]);
> if(a[i][1]>=0)
> a[i][2]=(int)ceil((double)16200/a[i][0])+a[i][1];
> else a[i][2]=0;
> }
> for(i=1;i<N;i++){
> for(j=1;j<=N-i;j++){
> if(a[j][2]>a[j+1][2]){
> p=a[j][2];
> a[j][2]=a[j+1][2];
> a[j+1][2]=p;
> }
> }
> if(a[1][2]>0)
> printf("%d\n",a[1][2]);
> else if(a[i][2]==0&&a[i+1][2]>0)
> printf("%d\n",a[i+1][2]);
>
> }
> 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