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

麻烦各位大牛帮我看看啊。。明明可以得出正确答案,为什么wa??

Posted by huangziss at 2009-04-01 23:32:09 on Problem 1547
#include"stdio.h"
#define m 1000
char name[m][m];
int a[m], b[m], c[m];
main(){
	int n, i, ji, d=999999, e=0;
	char *p1, *p2;
	while(1){
        scanf("%d", &n);
		if(n==-1) break;
		for(i=0; i<n; i++){
			scanf("%d%d%d %s", &a[i], &b[i], &c[i], name[i]);
			ji=a[i]*b[i]*c[i];
			if(ji>e) {e=ji; p1=name[i];}
			if(ji<d) {d=ji; p2=name[i];}
		}
		printf("%s took clay from %s.\n", p1, p2);
	}
}

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