Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这样为什么不行?

Posted by 90401303 at 2005-01-11 18:51:16 on Problem 1922
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator