Language: C++

#include<iostream>
using namespace std;
int main() {
????????int r,c,rs[101],cs;
????????cin >> r >> c;
????????int h[101][101];
????????for (int i = 0; i<r; i++) {
????????????????for (int j = 0; j<c; j++) {
????????????????????????cin >> h[i][j];
????????????????}
????????}
????????for (int i = 0; i < 101; i++) {
????????????????rs[i] = 0;
????????}
????????for (int i = 0; i <= r; i++) {
????????????????cs = 0;
????????????????for (int j = 0; j <= c; j++) {
????????????????????????if (i != r) {
????????????????????????????????if(j!=c)cs += h[i][j];
????????????????????????????????if (j != c)rs[j] += h[i][j];
????????????????????????????????if (j == c) cout << cs << endl;
????????????????????????????????else cout << h[i][j] << " ";
????????????????????????}
????????????????????????else {
????????????????????????????????if (j != c)cs += rs[j];
????????????????????????????????if (j == c) cout << cs << endl;
????????????????????????????????else cout << rs[j] << " ";
????????????????????????}
????????????????}
????????}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      | ^
a.cc:4:2: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |  ^
a.cc:4:3: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |   ^
a.cc:4:4: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |    ^
a.cc:4:5: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |     ^
a.cc:4:6: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |      ^
a.cc:4:7: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |       ^
a.cc:4:8: error: expected primary-expression before '?' token
    4 | ????????int r,c,rs[101],cs;
      |        ^
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int r,c,rs[101],cs;
      |         ^~~
a.cc:5:1: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      | ^
a.cc:5:2: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |  ^
a.cc:5:3: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |   ^
a.cc:5:4: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |    ^
a.cc:5:5: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |     ^
a.cc:5:6: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |      ^
a.cc:5:7: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |       ^
a.cc:5:8: error: expected primary-expression before '?' token
    5 | ????????cin >> r >> c;
      |        ^
a.cc:5:16: error: 'r' was not declared in this scope
    5 | ????????cin >> r >> c;
      |                ^
a.cc:5:21: error: 'c' was not declared in this scope
    5 | ????????cin >> r >> c;
      |                     ^
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:5:22: error: expected ':' before ';' token
    5 | ????????cin >> r >> c;
      |                      ^
      |                      :
a.cc:5:22: error: expected primary-expression before ';' token
a.cc:6:1: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      | ^
a.cc:6:2: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |  ^
a.cc:6:3: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |   ^
a.cc:6:4: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |    ^
a.cc:6:5: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |     ^
a.cc:6:6: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |      ^
a.cc:6:7: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |       ^
a.cc:6:8: error: expected primary-expression before '?' token
    6 | ????????int h[101][101];
      |        ^
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:6:9: error: expected ':' before 'int'
    6 | ????????int h[101][101];
      |         ^~~
      |         :
a.cc:6:9: error: expected primary-expression before 'int'
    6 | ????????int h[101][101];
      |         ^~~
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |  ^
a.cc:7:3: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |   ^
a.cc:7:4: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |    ^
a.cc:7:5: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |     ^
a.cc:7:6: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |      ^
a.cc:7:7: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |       ^
a.cc:7:8: error: expected primary-expression before '?' token
    7 | ????????for (int i = 0; i<r; i++) {
      |        ^
a.cc:7:9: error: expected primary-expression before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
a.cc:7:9: error: expected ':' before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
      |         :
a.cc:7:9: error: expected primary-expression before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
a.cc:7:9: error: expected ':' before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
      |         :
a.cc:7:9: error: expected primary-expression before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
a.cc:7:9: error: expected ':' before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
      |         :
a.cc:7:9: error: expected primary-expression before 'for'
    7 | ????????for (int i = 0; i<r; i++) {
      |         ^~~
a.cc:7:9: error: expected ':' before 'for'
    7 |