criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[i][j];
        
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) num[r][c]+=num[i][j];
        
    for(int i=0;i<r;i++){
        int sum=0;
        for(int j=0;j<c;j++) sum=+num[i][j];
        num[i][j]=sum;
    }
    
    for(int j=0;j<c;j++){
        int sum=0;
        for(int i=0;i<r;i++) sum+=num[i][j];
        num[r][j]=sum;
    }
    
    for(int i=0;i<=r;i++){
        for(int j=0;j<=c;j++){
            if(j) cout<<num[i][j];
        }
        cout<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'r' was not declared in this scope
    5 |     r,c;
      |     ^
a.cc:5:7: error: 'c' was not declared in this scope
    5 |     r,c;
      |       ^
a.cc:18:16: error: 'j' was not declared in this scope
   18 |         num[i][j]=sum;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[i][j];
        
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) num[r][c]+=num[i][j];
        
    for(int i=0;i<r;i++){
        int sum=0;
        for(int j=0;j<c;j++) sum=+num[i][j];
        num[i][c]=sum;
    }
    
    for(int j=0;j<c;j++){
        int sum=0;
        for(int i=0;i<r;i++) sum+=num[i][j];
        num[r][j]=sum;
    }
    
    for(int i=0;i<=r;i++){
        for(int j=0;j<=c;j++){
            if(j) cout<<num[i][j];
        }
        cout<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'r' was not declared in this scope
    5 |     r,c;
      |     ^
a.cc:5:7: error: 'c' was not declared in this scope
    5 |     r,c;
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[i][j];
        
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) num[r][c]+=num[i][j];
        
    for(int i=0;i<r;i++){
        int sum=0;
        for(int j=0;j<c;j++) sum=+num[i][j];
        num[i][c]=sum;
    }
    
    for(int j=0;j<c;j++){
        int sum=0;
        for(int i=0;i<r;i++) sum+=num[i][j];
        num[r][j]=sum;
    }
    
    for(int i=0;i<=r;i++){
        for(int j=0;j<=c;j++){
            if(j) cout<<" "; 
            cout<<num[i][j];
        }
        cout<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'r' was not declared in this scope
    5 |     r,c;
      |     ^
a.cc:5:7: error: 'c' was not declared in this scope
    5 |     r,c;
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
int x,y;
cin>>x>>y;

int a[1000][1000]={};
for(int i=1;i<=x;i++){
for(int g=1;g<=y;g++){
cin>>a[i][g];
}}

for(int i=1;i<=x;i++){
for(int g=1;g<=y;g++){
a[i][y+1]+=a[i][g];
}}
for(int i=1;i<=x;i++){
for(int g=1;g<=y;g++){
a[x+1][g]+=a[i][g];
}}

for(int i=1;i<=x+1;i++){
for(int g=1;g<=y+1;g+){
cout<<a[i][g];
if(g<=y){cout<<" ";}
}
cout<<endl;
}


return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:22: error: expected primary-expression before ')' token
   24 | for(int g=1;g<=y+1;g+){
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
int x,y;
cin>>x>>y;

int a[1000][1000]={};
for(int i=1;i<=x;i++){
for(int g=1;g<=y;g++){
cin>>a[i][g];
}}

for(int i=1;i<=x;i++){
for(int g=1;g<=y;g++){
a[i][y+1]+=a[i][g];
}}
for(int i=1;i<=x;i++){
for(int g=1;g<=y;g++){
a[x+1][g]+=a[i][g];
}}
for(int g=1;g<=y;g++){
a[x+1][y+1]+=a[x+1][g]
}

for(int i=1;i<=x+1;i++){
for(int g=1;g<=y+1;g++){
cout<<a[i][g];
if(g<=y){cout<<" ";}
}
cout<<endl;
}


return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: expected ';' before '}' token
   23 | a[x+1][y+1]+=a[x+1][g]
      |                       ^
      |                       ;
   24 | }
      | ~
Language: C++

#include <bits /stdc++.h>
using namespace std;

int main(){
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j=0;j<c;j++) num[r][c] += num[i][j];

    for(int i=0;i<r;i++){
        int sum =0;
        num[i][c] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(J) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc:1:10: fatal error: bits /stdc++.h: No such file or directory
    1 | #include <bits /stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits /stdc++.h>
using namespace std;

int main(){
    int r,c;
    cin >> r>>c;
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j=0;j<c;j++) num[r][c] += num[i][j];

    for(int i=0;i<r;i++){
        int sum =0;
        num[i][c] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(J) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc:1:10: fatal error: bits /stdc++.h: No such file or directory
    1 | #include <bits /stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int r,c;
    cin >> r>>c;
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j=0;j<c;j++) num[r][c] += num[i][j];

    for(int i=0;i<r;i++){
        int sum =0;
        num[i][c] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(J) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: expected ')' before ';' token
   12 |        for (int j =0;j=0;j<c;j++) num[r][c] += num[i][j];
      |            ~                ^
      |                             )
a.cc:12:30: error: 'j' was not declared in this scope
   12 |        for (int j =0;j=0;j<c;j++) num[r][c] += num[i][j];
      |                              ^
a.cc:21:13: error: 'J' was not declared in this scope
   21 |          if(J) cout <<" ";
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int r,c;
    cin >> r>>c;
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j<c;j++) num[r][c] += num[i][j];

    for(int i=0;i<r;i++){
        int sum =0;
        num[i][c] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(J) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'J' was not declared in this scope
   21 |          if(J) cout <<" ";
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int r,c;
    cin >> r>>c;
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j<c;j++) num[r][c] += num[i][j];

    for(int i=0;i<r;i++){
        int sum =0;
        for(int j=0;j<c;j++){
        num[i][c] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(j) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int r,c;
    cin >> r>>c;
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j<c;j++) num[r][c] += num[i][j];

    for(int i=0;i<r;i++){
        int sum =0;
        for(int j=0;j<c;j++) sum += num[i][j];
        num[r][j] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(j) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'j' was not declared in this scope
   17 |         num[r][j] = sum;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int r,c;
    cin >> r>>c;
    int num[101][101] = {};
    for (int i=0;i<r;i++)
       for (int j =0;j<c;j++) cin >>num[i][j];

    for(int i =0 ;i<r;i++) 
       for (int j =0;j<c;j++) num[r][c] += num[i][j];
       
    for(int i =0;i<r;i++){
        int sum;
        for(int j= 0;j<c;j++)sum +=num[i][j];
        num[i][j] = sum;
    }

    for(int i=0;i<r;i++){
        int sum =0;
        for(int j=0;j<c;j++) sum += num[i][j];
        num[r][j] = sum;
     }

    for(int i =0;i<=r;i++){
       for(int j=0;j<=c;j++){
         if(j) cout <<" ";
         cout <<num[i][j];
        }
        cout <<endl;
     }
      return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'j' was not declared in this scope
   17 |         num[i][j] = sum;
      |                ^
a.cc:23:16: error: 'j' was not declared in this scope
   23 |         num[r][j] = sum;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int r ,c,sum;
  cin >> r >> c;
  int a[101][101]= {};

  for(int i=0;i<r;i++)
    for(int j=0;j<c;j++) cin >> a[i][j];
  
  for(int i =0;i<r;i++)
    for(int j=0;j<c;j++) a[r][c] += a[i][j];

  for(int i=0;i<r;i++){
    sum = 0;
    for(int j=0;j<c;j++) sum += a[i][j];
    a[i][c] = sum;
  }

  for(int j=0;j<c;j++){
    sum = 0;
    for(int i=0;i<r;i++) sum += a[i][j];
    a[r][j] = sum;
  }

  for(int i=0;i<=r;i++){
    for(int j=0;j<=c;j++){
      if(j) cout << " ";
      cout << a[i][j];
    }
  cout <<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int r,c;
  cin>>r>>c;
  int matrix[200][200]={0};
  int matrixsum=0;
  for(int i=1;i<=r;i++)
    {
      for(int k=1;k<=c;k++)
	{
	  cin>>matrix[i][k];
	  matrixsum=matrixsum+matrix[i][k];
	}
    }
  int colsum[200]={0};
  int rowsum[200]={0};
  for(int i=1;i<=r;i++)
    {
      for(int k=1;k<=c;k++)
	{
	  colsum[i]=colsum[i]+matrix[i][k];
	}
    }
  for(int k=1;k<=c;k++)
    {
      for(int i=1;i<=r;i++)
	{
	  rowsum[k]=rowsum[k]+matrix[k][i];
	}
    }
  for(int i=1;i<=r +1;i++)
    {
      for(int k=1;k<=c+1;k++)
	{
	  


Compiler output:
a.cc: In function 'int main()':
a.cc:36:10: error: expected '}' at end of input
   36 |         {
      |         ~^
a.cc:36:10: error: expected '}' at end of input
a.cc:34:5: note: to match this '{'
   34 |     {
      |     ^
a.cc:36:10: error: expected '}' at end of input
   36 |         {
      |          ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int r,c;
  cin>>r>>c;
  int t[r+1][c+1];
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++) cin>>t[i][j];
  }for(int i=0;i<=r;i++) t[i][c]=0;
  for(int j=0;j<=c;j++) t[r][j]=0;
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      t[i][c]+=t[i][j];
      t[r][j]+=t[i][j];
      t[r][c]+=t[i][j];
    }
  }for(int i=0;i<=r;i++){
    for(int j=0;j<=c;j++){
      cout<<" ";
      cout<<t[i][j];
    } ccout<<endl;
  }return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'ccout' was not declared in this scope
   22 |     } ccout<<endl;
      |       ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int r,c;
  cin>>r>>c;
  int t[r+1][c+1];
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++) cin>>t[i][j];
  }for(int i=0;i<=r;i++) t[i][c]=0;
  for(int j=0;j<=c;j++) t[r][j]=0;
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      t[i][c]+=t[i][j];
      t[r][j]+=t[i][j];
      t[r][c]+=t[i][j];
    }
  }for(int i=0;i<=r;i++){
    for(int j=0;j<=c;j++){
    if(j) {
      cout<<" ";
      cout<<t[i][j];
    }cout<<endl;
  }return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <iterator>
#include <sstream>
#include <string>
#include <algorithm>
#include <limits>

using namespace std;

int main()
{
  //skip the first line
//  cin.ignore(numeric_limits<streamsize>::max(), '\n');
  int r, c;
  cin >> r >> c;
  cin.ignore(numeric_limits<streamsize>::max(), '\n');

  vector<int> row_sums;
  vector<int> column_sums(c);

  for (string line; getline(cin, line);) {
    istringstream is {line};
    int n, row_sum = 0;
    auto column_it = column_sums.begin();
    while (is >> n) {
      cout << n << " ";
      row_sum += n;
      *column_it += n;
      ++column_it;
    }

    row_sums.push_back(row_sum);

    cout << row_sum << endl;
  }

  for (int x : column_sums)
    cout << x << " ";

  // finally, print out the sum of the row sums (= the sum of the column sums)
  cout << accumulate(row_sums.begin(), row_sums.end(), 0) << endl; 
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'vector' was not declared in this scope
   18 |   vector<int> row_sums;
      |   ^~~~~~
a.cc:7:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    6 | #include <limits>
  +++ |+#include <vector>
    7 | 
a.cc:18:10: error: expected primary-expression before 'int'
   18 |   vector<int> row_sums;
      |          ^~~
a.cc:19:10: error: expected primary-expression before 'int'
   19 |   vector<int> column_sums(c);
      |          ^~~
a.cc:24:22: error: 'column_sums' was not declared in this scope; did you mean 'column_it'?
   24 |     auto column_it = column_sums.begin();
      |                      ^~~~~~~~~~~
      |                      column_it
a.cc:32:5: error: 'row_sums' was not declared in this scope; did you mean 'row_sum'?
   32 |     row_sums.push_back(row_sum);
      |     ^~~~~~~~
      |     row_sum
a.cc:37:16: error: 'column_sums' was not declared in this scope
   37 |   for (int x : column_sums)
      |                ^~~~~~~~~~~
a.cc:41:22: error: 'row_sums' was not declared in this scope
   41 |   cout << accumulate(row_sums.begin(), row_sums.end(), 0) << endl;
      |                      ^~~~~~~~
a.cc:41:11: error: 'accumulate' was not declared in this scope
   41 |   cout << accumulate(row_sums.begin(), row_sums.end(), 0) << endl;
      |           ^~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int r,c;
cin>>r>>c;
c++;
int a[r][c];

for(int i=0;i<=r;i++){
 for(int j=0;j<=c-2;j++){
  cin>>a[i][j];
 }
}

for(int i=0;i<=r;i++){
 for(int j=0;j<=c-2;j++){
  a[i][c-1] += a[i][j];
 }
}

for(int i=0;i<=r;i++){
 for(int j=0;j<=c-2;j++{
  cout<<a[i][j]<<" ";
 }
cout<<a[i][c-1]<<endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: expected ')' before '{' token
   22 |  for(int j=0;j<=c-2;j++{
      |     ~                  ^
      |                        )
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int r,c;
cin>>r>>c;
c++;
int a[r][c];

for(int i=0;i<=r;i++){
 for(int j=0;j<=c-2;j++){
  cin>>a[i][j];
 }
}

for(int i=0;i<=r;i++){
 for(int j=0;j<=c-2;j++){
  a[i][c-1] += a[i][j];
 }
}

for(int i=0;i<=r;i++){
 for(int j=0;j<=c-2;j++{
  cout<<a[i][j]<<" ";
 }
cout<<a[i][c-1]<<endl;
}

}




Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: expected ')' before '{' token
   22 |  for(int j=0;j<=c-2;j++{
      |     ~                  ^
      |                        )
Language: C++

#include<iostream>
using namespace std;
int main(){
int r,c;
cin>>r>>c;
r++;
c++;
int a[r][c];


/*配列代入*/

for(int i=0;i<r-1;i++){
 for(int j=0;j<c-1;j++){
  cin>>a[i][j];
 }
}

/*総和横*/

for(int i=0;i<r;i++){
int yokosum=0;
 for(int j=0;j<c;j++){
yokosum = yokosum + a[i][j];
 }
a[i][c]=yokosum;
}

/*総和縦*/

for(int j=0;j<=c;j++){
int tatesum =0;
 for(int i=0;i<r;i++){
tatesum = tatesum + a[i][j];
 }
a[r][j] = tatesum;
}

/*総和総合*/

for(int i=0;i<c-1;i++){
 a[r-1][c-1] += [r-1][i];
}

/*出力*/

for(int i=0;i<=r;i++){
 for(int j=0;j<c-;j++){
  cout<<a[i][j];
  if(j == c){
  }else{
   cout<<endl;
  }
 }
if(i == r){
}else{
cout<<endl;
}
}
cout<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:42:19: error: expected ',' before '-' token
   42 |  a[r-1][c-1] += [r-1][i];
      |                   ^
      |                   ,
a.cc:42:19: error: expected identifier before '-' token
a.cc: In lambda function:
a.cc:42:22: error: expected '{' before '[' token
   42 |  a[r-1][c-1] += [r-1][i];
      |                      ^
a.cc: In function 'int main()':
a.cc:42:22: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:48:18: error: expected primary-expression before ';' token
   48 |  for(int j=0;j<c-;j++){
      |                  ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int r,c;
cin>>r>>c;
r++;
c++;
int a[r][c];


/*配列代入*/

for(int i=0;i<r-1;i++){
 for(int j=0;j<c-1;j++){
  cin>>a[i][j];
 }
}

/*総和横*/

for(int i=0;i<r;i++){
int yokosum=0;
 for(int j=0;j<c;j++){
yokosum = yokosum + a[i][j];
 }
a[i][c]=yokosum;
}

/*総和縦*/

for(int j=0;j<=c;j++){
int tatesum =0;
 for(int i=0;i<r;i++){
tatesum = tatesum + a[i][j];
 }
a[r][j] = tatesum;
}


/*出力*/

for(int i=0;i<=r;i++){
 for(int j=0;j<c-;j++){
  cout<<a[i][j];
  if(j == c){
  }else{
   cout<<endl;
  }
 }
if(i == r){
}else{
cout<<endl;
}
}
cout<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: expected primary-expression before ';' token
   43 |  for(int j=0;j<c-;j++){
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int r, c;
    cin >> r >> c;
    int t[r][c], f[r], ans[c];
    for(int i = 0; i < r; i++){
        for(int j = 0; j < c; j++){
            cin >> t[i][j];
        }
    }
    for(int i = 0; i < r; i++){
        f = 0;
        for(int j = 0; j < c; j++){
            if(j > 0) cout << " ";
            cout << t[i][j];
            f[i] += t[i][j];
        }
        cout << " " << f[i] << endl;
    }
    for(int i = 0; i < c; i++){
        for(int j = 0; j < r; j++){
            ans[i] += t[j][i];
        }
    }
    for(int i = 0; i < c; i++){
        if(i > 0) cout << " ";
        cout << ans[i];
    }
    cout << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: incompatible types in assignment of 'int' to 'int [r]'
   14 |         f = 0;
      |         ~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace int;

int main(){
  int r,c;
  int x[r+1][c+1]={};
  cin>>r>>c;
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      cin>>x[i][j];
    }
  }
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      x[i][c]+=x[i][j];
      
    }
  }
  for(int i=0;i<c;i++){
    for(int j=0;j<r;j++){
      x[r][j]+=x[i][j];
      
    }
  }
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      cout<<x[i][j];
    }
  }
}



Compiler output:
a.cc:2:17: error: expected identifier before 'int'
    2 | using namespace int;
      |                 ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace int;
      |                ^~~~
      |                ;
a.cc:2:17: error: declaration does not declare anything [-fpermissive]
    2 | using namespace int;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>r>>c;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:27:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |       cout<<x[i][j];
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#Include<bits/stdc++.h>
using namespace std;

int main(){
  int r,c;
  int x[r][c]={};
  cin>>r>>c;
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      cin>>x[i][j];
    }
  }
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      x[i][c]+=x[i][j];
      
    }
  }
  for(int i=0;i<c;i++){
    for(int j=0;j<r;j++){
      x[r][j]+=x[i][j];
      
    }
  }
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      cout<<x[i][j]<<" ";
    }
    cout<<endl;
  }
}



Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>r>>c;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #Include<bits/stdc++.h>
a.cc:27:7: error: 'cout' was not declared in this scope
   27 |       cout<<x[i][j]<<" ";
      |       ^~~~
a.cc:27:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout<<endl;
      |     ^~~~
a.cc:29:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:11: error: 'endl' was not declared in this scope
   29 |     cout<<endl;
      |           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #Include<bits/stdc++.h>
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n,m;
    cin >> n >> m;
    int a[n][m];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin >> a[i][j];
        }
    }
    int q[n]=0,w[m]=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            q[i]+=a[i][j];
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            w[i]+=a[j][i];
        }
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=q[i];
    }
    for(int j=0;j<m;j++){
        sum+=w[j];
    }
     for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cout << a[i][j] << " " ;
        }
        cout << q[i] << endl;
    }
    for(int i=0;i<m;i++)
        cout << w[i];
    cout << sum << endl;
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: array must be initialized with a brace-enclosed initializer
   15 |     int q[n]=0,w[m]=0;
      |              ^
a.cc:15:21: error: array must be initialized with a brace-enclosed initializer
   15 |     int q[n]=0,w[m]=0;
      |                     ^
Language: C++

#include <stdio.h>
int main(void)
{ 
    int r, c, i, j;
    int elements[101][101] = { 0 };
    scanf("%d %d", &r, &c);
    for (j = 0; j < r; j++){
        for (i = 0; i < c; i++){
            scanf("%d", &elements[j][i]);
            elements[j][c] += elements[j][i];
            elements[r][i] += elements[j][i];
            } 
        
    }
    for (i = 0; i < c; i++){
        elements[r][c] += elements[r][i];
        }
        for (j = 0; j <= r; j++){
            for (i = 0; i <= c; i++){
                printf("%d", elements[j][i]);
                if (i < c){
                    printf(" ");
                }
                else{
                    printf("\n");
                }
            }
        }
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: expected '}' at end of input
   29 |     return 0;
      |              ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int r, c;
    int ver[101][101];
    
    cin >> r >> c;
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c;j++){
            cin >> ver[i][j];
        }
    }
    
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c + 1;j++){
            if(j == c){
                for(int k = 0;k < c;k++){
                    ver[i][j+1] += ver[i][k];
                }
                cout << ver[i][j+1];
            }
            else{
                cout << ver[i][j] << " ";
            }
        }
        cout << endl;
    }
    
    for(int i = 0;i < c;i++){
        int sum = 0;
        for(int j = 0;j < r + 1;j++){
            sum += ver[i][j]
            if(j == r){
                cout << sum << " ";
            }
        }
    }
    cout << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:29: error: expected ';' before 'if'
   33 |             sum += ver[i][j]
      |                             ^
      |                             ;
   34 |             if(j == r){
      |             ~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    int r, c;
    int ver[101][101];
    
    cin >> r >> c;
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c;j++){
            cin >> ver[i][j];
        }
    }
    
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c + 1;j++){
            if(j == c){
                for(int k = 0;k < c;k++){
                    ver[i][j] += ver[i][k];
                }
                cout << ver[i][j];
            }
            else{
                cout << ver[i][j] << " ";
            }
        }
        cout << endl;
    }
    
    for(int i = 0;i < c + 1;i++){
        int sum = 0;
        for(int j = 0;j < r + 1;j++){
            sum += ver[j][i];
            if(j == r){
                if(i == (c + 1){
                    cout << sum << endl;
                }
                else{
                    cout << sum << " ";
                }
            }
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:32: error: expected ')' before '{' token
   35 |                 if(i == (c + 1){
      |                   ~            ^
      |                                )
a.cc:41:13: error: expected primary-expression before '}' token
   41 |             }
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c,sum=0;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[101][101];
        
        for(i=0;i<r;i++){
            sum=0;
            for(j=0;j<c;j++){
                sum += num[i][j];
                num[i][c] += sum;
            }
        }
        
        for(j=0;J<c;J++){
            sum = 0;
            for(i=0;i<r;i++){
             sum += num[i][j];
             num[r][j];
            }
        }
        for(i=0;i<=r;i++){
            for(j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'i' was not declared in this scope
   14 |         for(i=0;i<r;i++){
      |             ^
a.cc:16:17: error: 'j' was not declared in this scope
   16 |             for(j=0;j<c;j++){
      |                 ^
a.cc:22:13: error: 'j' was not declared in this scope
   22 |         for(j=0;J<c;J++){
      |             ^
a.cc:22:17: error: 'J' was not declared in this scope
   22 |         for(j=0;J<c;J++){
      |                 ^
a.cc:24:17: error: 'i' was not declared in this scope
   24 |             for(i=0;i<r;i++){
      |                 ^
a.cc:29:13: error: 'i' was not declared in this scope
   29 |         for(i=0;i<=r;i++){
      |             ^
a.cc:30:17: error: 'j' was not declared in this scope
   30 |             for(j=0;j<=c;j++){
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c,sum=0,i,j;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(i=0;i<r;i++)
        for(j=0;j<c;j++) cin>>num[101][101];
        
        for(i=0;i<r;i++){
            sum=0;
            for(j=0;j<c;j++){
                sum += num[i][j];
                num[i][c] += sum;
            }
        }
        
        for(j=0;J<c;J++){
            sum = 0;
            for(i=0;i<r;i++){
             sum += num[i][j];
             num[r][j];
            }
        }
        for(i=0;i<=r;i++){
            for(j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'J' was not declared in this scope
   22 |         for(j=0;J<c;J++){
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){ 
        cin>>num[101][101];
        
        for(int i=0;i<r;i++){
        int sum=0;
            for(int j=0;j<c;j++){ 
            int sum += num[i][j];
                num[i][c] += sum;
            }
        }
        
       for(int j=0;j<c;j++){ 
        int sum = 0;
            for(int i=0;i<r;i++){
    int sum += num[i][j];
             num[r][j];
            }
        }
        for(int i=0;i<=r;i++){
           for(int j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected initializer before '+=' token
   18 |             int sum += num[i][j];
      |                     ^~
a.cc:26:13: error: expected initializer before '+=' token
   26 |     int sum += num[i][j];
      |             ^~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:11:25: note: to match this '{'
   11 |     for(int i=0;i<r;i++){
      |                         ^
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){ 
        cin>>num[101][101];
        
        for(int i=0;i<r;i++){
        int sum=0;
            for(int j=0;j<c;j++){ 
            int sum += num[i][j];
                num[i][c] += sum;
            }
        }
        }
        
       for(int j=0;j<c;j++){ 
        int sum = 0;
            for(int i=0;i<r;i++){
    int sum += num[i][j];
             num[r][j];
            }
        }
    }
        for(int i=0;i<=r;i++){
           for(int j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected initializer before '+=' token
   18 |             int sum += num[i][j];
      |                     ^~
a.cc:27:13: error: expected initializer before '+=' token
   27 |     int sum += num[i][j];
      |             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[101][101];
        
         for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) num[r][c] += num[i][j];
        
        for(int i=0;i<r;i++){
          int sum=0;
            for(int j=0;j<c;j++){ 
            sum += num[i][j];
                num[i][c] += sum;
            }
        }
        }
        
       for(int j=0;j<c;j++){ 
        int sum = 0;
            for(int i=0;i<r;i++){
              sum += num[i][j];
             num[r][j];
            }
        }
    }
        for(int i=0;i<=r;i++){
           for(int j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        
        return 0;
}


Compiler output:
a.cc:26:8: error: expected unqualified-id before 'for'
   26 |        for(int j=0;j<c;j++){
      |        ^~~
a.cc:26:20: error: 'j' does not name a type
   26 |        for(int j=0;j<c;j++){
      |                    ^
a.cc:26:24: error: 'j' does not name a type
   26 |        for(int j=0;j<c;j++){
      |                        ^
a.cc:33:5: error: expected declaration before '}' token
   33 |     }
      |     ^
a.cc:34:9: error: expected unqualified-id before 'for'
   34 |         for(int i=0;i<=r;i++){
      |         ^~~
a.cc:34:21: error: 'i' does not name a type
   34 |         for(int i=0;i<=r;i++){
      |                     ^
a.cc:34:26: error: 'i' does not name a type
   34 |         for(int i=0;i<=r;i++){
      |                          ^
a.cc:43:9: error: expected unqualified-id before 'return'
   43 |         return 0;
      |         ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[101][101];
        
         for(int i=0;i<r;i++)
            for(int j=0;j<c;j++) num[r][c] += num[i][j];
        
        for(int i=0;i<r;i++){
          int sum=0;
            for(int j=0;j<c;j++){ 
            sum += num[i][j];
                num[i][c] += sum;
            }
        }
        }
        
       for(int j=0;j<c;j++){ 
        int sum = 0;
            for(int i=0;i<r;i++){
              sum += num[i][j];
             num[r][j];
            }
        }
    }
        for(int i=0;i<=r;i++){
           for(int j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        
        return 0;
}


Compiler output:
a.cc:26:8: error: expected unqualified-id before 'for'
   26 |        for(int j=0;j<c;j++){
      |        ^~~
a.cc:26:20: error: 'j' does not name a type
   26 |        for(int j=0;j<c;j++){
      |                    ^
a.cc:26:24: error: 'j' does not name a type
   26 |        for(int j=0;j<c;j++){
      |                        ^
a.cc:33:5: error: expected declaration before '}' token
   33 |     }
      |     ^
a.cc:34:9: error: expected unqualified-id before 'for'
   34 |         for(int i=0;i<=r;i++){
      |         ^~~
a.cc:34:21: error: 'i' does not name a type
   34 |         for(int i=0;i<=r;i++){
      |                     ^
a.cc:34:26: error: 'i' does not name a type
   34 |         for(int i=0;i<=r;i++){
      |                          ^
a.cc:43:9: error: expected unqualified-id before 'return'
   43 |         return 0;
      |         ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    int r,c;
    cin>>r>>c;
    
    int num[101][101]={};
    
    for(int i=0;i<r;i++)
        for(int j=0;j<c;j++) cin>>num[101][101];
        
       
        for(int i=0;i<r;i++){
          int sum=0;
            for(int j=0;j<c;j++){ 
            sum += num[i][j];
                num[i][c] += sum;
            }
        }
        }
        
       for(int j=0;j<c;j++){ 
        int sum = 0;
            for(int i=0;i<r;i++){
              sum += num[i][j];
             num[r][j];
            }
        }
    }
        for(int i=0;i<=r;i++){
           for(int j=0;j<=c;j++){
                if(j) cout<<" ";
                cout<<num[i][j];
            }
            cout<<endl;
        }
        
        
        return 0;
}


Compiler output:
a.cc:24:8: error: expected unqualified-id before 'for'
   24 |        for(int j=0;j<c;j++){
      |        ^~~
a.cc:24:20: error: 'j' does not name a type
   24 |        for(int j=0;j<c;j++){
      |                    ^
a.cc:24:24: error: 'j' does not name a type
   24 |        for(int j=0;j<c;j++){
      |                        ^
a.cc:31:5: error: expected declaration before '}' token
   31 |     }
      |     ^
a.cc:32:9: error: expected unqualified-id before 'for'
   32 |         for(int i=0;i<=r;i++){
      |         ^~~
a.cc:32:21: error: 'i' does not name a type
   32 |         for(int i=0;i<=r;i++){
      |                     ^
a.cc:32:26: error: 'i' does not name a type
   32 |         for(int i=0;i<=r;i++){
      |                          ^
a.cc:41:9: error: expected unqualified-id before 'return'
   41 |         return 0;
      |         ^~~~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main()
{
	int r,c,max,i,j,x,count=0,countAll=0;
	vector<int> v;

	cin >> r >> c ;

	max = r*c;

	for(i=0;i<max;i++)
	{
		cin >> x ;
		v.push_back(x);
	}

	for(i=0;i<max;i++)
	{
		cout << v[i] << ' ' ;
		count += v[i] ; 

		if(((i+1)%c)==0)
		{
			cout << count << endl ;
			countAll += count;
			count = 0;
		}
	}

	for(i=0;i<c;i++)
	{
		for(j=0;j<r;j++)
		{
			count += v[i+(5*j)];
		}

		cout << count << ' ' ;
		countAll += count ;
		count=0;
	}

	countAll = counAll / 2 ;

	cout << countAll << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:20: error: 'counAll' was not declared in this scope; did you mean 'countAll'?
   45 |         countAll = counAll / 2 ;
      |                    ^~~~~~~
      |                    countAll
Language: C++

 #include <iostream>
    using namespace std;
     
    int main() {
int t,y ;
cin >> t >> y ;
int a[t+1][y+1];
for(int i=0 ; i<t+1 ; i++){
	a[i][y]=0
}
for (int j=0 ; j<y+1 ;j++){
	a[t][j]=0
}
for(int i=0 ; i<t ; i++ ){
	for(int j=0 ; j<y ; j++){
		cin >> a[i][j];
	}
}
for (int i=0 ; i<t ; i++){
	for (int j=0 ; j<y ; j++){
		a[i][y]=a[i][y]+a[i][j];
	}
}
for (int j=0 ; j<y+1 ; j++){
	for (int i=0 ; i<t ;i++){
		a[t][j]=a[t][j]+a[i][j];
	}
}
for (int i=0 ; i<t ; i++){
	for (int j=0 ; j<y ; j++){
		cout<< a[i][j] << " ";
	}
	cout <<a[i][y]<< endl;
}
for (int j=0 ; j<y ; j++){
		cout<< a[t][j] << " ";
	}
	cout <<a[t][y]<< endl;
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '}' token
    9 |         a[i][y]=0
      |                  ^
      |                  ;
   10 | }
      | ~                 
a.cc:12:18: error: expected ';' before '}' token
   12 |         a[t][j]=0
      |                  ^
      |                  ;
   13 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int main()
{
	int r,c;

	cin >> r >> c ;
	double **cell = new double*[r+1];
	for(int i=0;i<r+1;++i)
		cell[i] = new double[c+1];

	for(int i=0;i<r;++i)
		for(int j=0;j<c;++j)
			cin >> cell[i][j];

	for(int i=0;i<r;++i){
		int count = 0;
		for(int j=0;j<c;++j){
			count += cell[i][j];
		}
		cell[i][c] = count;
	}

	for(int i=0;i<c;++i){
		int count = 0;
		for(int j=0;j<r;++j){
			count += cell[j][i];
		}
		cell[r][i] = count;
	}

	int count = 0;
	for(int i=0;i<c;++i){
		count += cell[r][i];
	}
	cell[r][c] = count;


	for(int i=0;i<=r;++i){
		for(int j=0;j<=c;++j){
			cout << cell[i][j] << ' ';
		}
		cout << endl;
	}

	for(int i=0;i<r+1;++i)
		delete[] cell[i];
	delete[] cell;
	return 0;
}#include<iostream>
using namespace std;

int main()
{
	int r,c;

	cin >> r >> c ;
	double **cell = new double*[r+1];
	for(int i=0;i<r+1;++i)
		cell[i] = new double[c+1];

	for(int i=0;i<r;++i)
		for(int j=0;j<c;++j)
			cin >> cell[i][j];

	for(int i=0;i<r;++i){
		int count = 0;
		for(int j=0;j<c;++j){
			count += cell[i][j];
		}
		cell[i][c] = count;
	}

	for(int i=0;i<c;++i){
		int count = 0;
		for(int j=0;j<r;++j){
			count += cell[j][i];
		}
		cell[r][i] = count;
	}

	int count = 0;
	for(int i=0;i<c;++i){
		count += cell[r][i];
	}
	cell[r][c] = count;


	for(int i=0;i<=r;++i){
		for(int j=0;j<=c;++j){
			cout << cell[i][j] << ' ';
		}
		cout << endl;
	}

	for(int i=0;i<r+1;++i)
		delete[] cell[i];
	delete[] cell;
	return 0;
}

Compiler output:
a.cc:51:2: error: stray '#' in program
   51 | }#include<iostream>
      |  ^
a.cc:51:3: error: 'include' does not name a type
   51 | }#include<iostream>
      |   ^~~~~~~
a.cc:54:5: error: redefinition of 'int main()'
   54 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(void)
{
int x,y;
cin>>x;
cin>>y;
int num[x+1][y+1];
for(int i=0;i<x;i++)
{
int sum1=0;
	for(int j=0;j<y;j++)
	{
	cin>>num[i][j];
	sum1+=num[i][j];
	
	}
	
	num[i][y]=sum1;
}
for(int i=0;i<y+1;i++)
{
int sum2=0;
	for(int j=0;j<x;j++)
	{
	sum2+=num[j][i];
	}
	num[x][i]=sum2;
}
for(int i=0;i<x+1;i++)
{
	for(int j=0;j<y+1;j++)
	{
	cout<<num[i][j]<<" ";
	}
	cout<<endl;
}
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: expected '}' at end of input
   38 | return 0;
      |          ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++


int main(){
	int r, c;

	cin >> r >> c;

	int **table = new int*[r+1];
	for (int i = 0; i < r+1; i++){
		table[i] = new int[c+1];
	}
	for (int i = 0; i < r + 1; i++){
		for (int j = 0; j < c + 1; j++){
			table[i][j] = 0;
		}
	}
	for (int i = 0; i < r; i++){
		for (int j = 0; j < c; j++){
			cin >> table[i][j];
			table[i][c] +=  table[i][j];
			table[r][j] += table[i][j];
			table[r][c] += table[i][j];
		}
	}
	for (int i = 0; i < r+1; i++){
		for (int j = 0; j < c+1; j++){
			cout << table[i][j];
			if (j != c) cout << " ";
		}
		cout << endl;
	}
	for (int j = 0; j < c + 1; j++){

	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> r >> c;
      |         ^~~
a.cc:26:25: error: 'cout' was not declared in this scope
   26 |                         cout << table[i][j];
      |                         ^~~~
a.cc:29:17: error: 'cout' was not declared in this scope
   29 |                 cout << endl;
      |                 ^~~~
a.cc:29:25: error: 'endl' was not declared in this scope
   29 |                 cout << endl;
      |                         ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  
  int i,j,r,c;
  int num[10000][100] ;
  
  cin >>r >>c;
  
  if(r<1 || c > 100) cout <<"Too large"
    else{ 
      for(i=0;i<r;i++){
	
	for(j=0;j<c;j++){
	  
	  cin >>num[i][j];
	}
      }
      
      for(i=0;i<r;i++){
	
	for(j=0;j<c;j++){
	  
	  num[i][c] += num[i][j];
	}
      }	
      
      for(i=0;i<c;i++){
	
	for(j=0;j<r;j++){
	  
	  num[r][i] += num[j][i] ;
	}
	num[r][c] += num[r][i];
      }
      
      for(i=0;i<r;i++){
	for(j=0;j<c;j++){
	  
	  cout<<num[i][j] <<" " ;
	}
	cout<<num[i][c] <<"\n" ;
      }
      for(i=0;i<c;i++){
	
	cout <<num[r][i] <<" " ; 
      }
      cout<<num[r][c];
      cout <<"\n" ;
    }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:40: error: expected ';' before 'else'
   11 |   if(r<1 || c > 100) cout <<"Too large"
      |                                        ^
      |                                        ;
   12 |     else{
      |     ~~~~
Language: Java

object Main extends App {

  val Array(n, m, l) = io.StdIn.readLine().split(" ").map(_.toInt)

  val a = Array.ofDim[Int](n,m)
  val b = Array.ofDim[Int](m,l)
  for(i <- 0 until n)
    a(i) = io.StdIn.readLine().split(" ").map(_.toInt)
  for(i <- 0 until m)
    b(i) = io.StdIn.readLine().split(" ").map(_.toInt)

  val ans: Array[Array[Long]] = Array.ofDim[Long](n,l)
  for(i <- 0 until n; j <- 0 until l)
    ans(i)(j) = (0 until m).foldLeft(0) {
      (acc,k) => acc + a(i)(k) * b(k)(j)
    }

  val sb = StringBuilder.newBuilder
  for(e <- ans)
    sb.append(e.mkString(" ")).append("\n")
  println(sb)
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
object Main extends App {
^
Main.java:13: error: class, interface, enum, or record expected
  for(i <- 0 until n; j <- 0 until l)
                      ^
2 errors
Language: Java

object Main extends App {

  val Array(n, m, l) = io.StdIn.readLine().split(" ").map(_.toInt)

  val a = Array.ofDim[Int](n,m)
  val b = Array.ofDim[Int](m,l)
  for(i <- 0 until n)
    a(i) = io.StdIn.readLine().split(" ").map(_.toInt)
  for(i <- 0 until m)
    b(i) = io.StdIn.readLine().split(" ").map(_.toInt)

  val ans: Array[Array[Long]] = Array.ofDim[Long](n,l)
  for(i <- 0 until n; j <- 0 until l)
    ans(i)(j) = (0 until m).foldLeft(0) {
      (acc,k) => acc + a(i)(k) * b(k)(j)
    }

  val sb = StringBuilder.newBuilder
  for(e <- ans)
    sb.append(e.mkString(" ")).append("\n")
  print(sb)
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
object Main extends App {
^
Main.java:13: error: class, interface, enum, or record expected
  for(i <- 0 until n; j <- 0 until l)
                      ^
2 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n, m, l;
        
        n =  sc.nextInt();
        m = sc.nextInt();
        l = sc.nextInt();
        
        int[][] a = new int[n][m];
        int[][] b = new int[m][l];
        long[][] c = new int[n][l];
        
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                a[i][j] = sc.nextInt();
            }
        }
        
        for(int i = 0; i < m; i++) {
            for(int j = 0; j < l; j++) {
                b[i][j] = sc.nextInt();
            }
        }
        
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < l; j++) {
                c[i][j] = 0;
            }
        }
        
        
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < l; j++) {
                for(int k = 0; k < m; k++) {
                    c[i][j] += a[i][k] * b[k][j];
                }
            }
        }
        
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < n; i++){
            for(int j = 0; j < l; j++){
                sb.append(c[i][j]);
                if(j != l-1) sb.append(" ");
            }
            if(i != n-1) sb.append("\n");
        }
        System.out.println(sb);
        
    }
}



Compiler output:
Main.java:15: error: incompatible types: int[][] cannot be converted to long[][]
        long[][] c = new int[n][l];
                     ^
1 error
Language: Java

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int l=sc.nextInt();
        int[][] nm=new int[n][m];
        int[][] ml=new int[m][l];
        int[][] nl=new int[n][l];
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                nm[i][j]=sc.nextInt();
            }
        }
        for(int k=0;k<m;k++){
            for(int p=0;p<l;p++){
                ml[k][p]=sc.nextInt();
            }
        }for(int a=0;a<n;a++){
            for(int b=0;b<l;b++){
                int sum=0;
                for(int c=0;c<m;c++){
                    sum+=nm[a][c]*ml[c][b];
                }
                nl[a][b]=sum;
            }
        }
        for(int d=0;d<n;d++){
            for(int e=0;e<l;e++){
                System.out.print(nl[d][e]);
                if(e!=l)){
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}


Compiler output:
Main.java:32: error: illegal start of expression
                if(e!=l)){
                        ^
1 error