Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
44677 teacher_lu 九宫格 C++ Accepted 0 MS 244 KB 784 2024-04-02 16:59:11

Tests(2/2):


#include <bits/stdc++.h> using namespace std; int main(){ int m, n; n = 3; m = 3; int a[m+1][n+1]; bool f = 1; for(int i=1;i<=n;i++) { int hang = 0; for(int j=1;j<=m;j++){ cin >> a[i][j]; hang += a[i][j]; } if(hang != 15) { f = 0; } } for(int i=1;i<=m;i++) { int r = 0; for(int j=1;j<=n;j++){ r += a[j][i]; } if(r != 15) { f = 0; } } int x = 0, y = 0; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(i==j) x+=a[i][j]; if(i+j==4) y+=a[i][j]; } } if(x!=15 or y!=15) f = 0; if(f==1) cout << 1; else cout << 0; return 0; }


Judgement Protocol: