Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6700 | 黄言岐 | 对角线之和 | C++ | Wrong Answer | 0 MS | 260 KB | 773 | 2025-03-12 20:04:01 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int N,a[11][11],c; int b; for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ cin>>a[i][j]; if(i==j) b+=a[i][j]; if(i+j==N-1) b+=a[i][j]; } } for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ if(i==j) b+=a[i][j]; if(i+j==N-1) b+=a[i][j]; if(N%2!=0) c=a[N/2][N/2]; } } cout<<b-c<<endl; return 0; }
------Input------
8 792 445 95 669 407 328 748 245 189 20 785 571 19 269 25 400 413 222 73 509 535 571 933 216 768 617 496 63 910 324 187 988 515 618 618 994 63 135 820 703 237 695 458 259 706 235 145 120 908 158 619 297 823 928 298 408 606 789 607 795 687 654 18 103
------Answer-----
5614
------Your output-----
1177359880