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 |
麻烦各位大牛帮我看看啊。。明明可以得出正确答案,为什么wa??#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator