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 |
为什么会是 WRONG ANSWER? HELP~~~~~~~~~#include<iostream> #include<math.h> using namespace std; int main() { int n[11][5]={0}; char name[11][10]; int student=0; while (student!=-1) { int maxClay=n[1][4],minClay=n[1][4]; int max=1,min=1; cin>>student; if (student==-1) break; for (int j=1;j<=student;j++) { cin>>n[j][1]>>n[j][2]>>n[j][3]; n[j][4]=n[j][1]*n[j][2]*n[j][3]; cin>>name[j]; } for (int p=1;p<=student;p++) { if (n[p][4]>maxClay) { maxClay=n[p][4]; max=p; } } for (int q=1;q<=student;q++) { if (n[q][4]<=minClay) { minClay=n[q][4]; min=q; } } cout<<name[max]<<" took clay from "<<name[min]<<"."<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator