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? 谢谢#include<stdio.h> #include<memory> using namespace std; int a[100+2][100+2]; int grade[100+2]; int main() { int n; int i,j; int maxg; while(scanf("%d",&n) != EOF) { for(i=0;i<n;i++) //input for(j=0;j<n;j++) scanf("%d",&a[i][j]); memset(grade,0,sizeof(grade)); for(i=0;i<n;i++) for(j=0;j<n;j++) grade[i] += a[i][j]; maxg = grade[0]; for(i=1;i<n;i++) //output if(grade[i] > maxg) { j = i; maxg = grade[i]; } printf("%d\n",j+1); } return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator