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

#include<stdio.h>

int main(void){
  
  int r,c,n,i,j,f;


  scanf("%d %d",&r,&c);
 

  int s[r+1][c+1];

  for(i=0;i<r+1;i++){
    for(j=0;j<c+1;j++){
      t[i][j]=0;
    }
  }

  for(i=1; i<=r; i++)
    for(j=1; j<=c; j++){
      scanf(" %d",&s[i][j]);
      s[i][c+1] += s[i][j];
    }
  for(j=1; j<=c+1; j++)
    for(i=1; i<=r; i++)
      s[r+1][j] += s[i][j];
 
  for(i=1; i<=r+1; i++){
    for(j=1; j<=c+1; j++){
      printf("%d",s[i][j]);
      if(j!=c+1) putchar(' ');
    }
    putchar('\n');
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:7: error: 't' undeclared (first use in this function)
   15 |       t[i][j]=0;
      |       ^
main.c:15:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
  int array[100][100]={},r,c;
  int i,j;
  
  scanf("%d%d",&r,&c);
  for(i=0;i<r;i++){
    for(j=0;j<c;j++){
      scanf("%d",&array[i][j]);
      array[i][c]+=array[i][j];
    }
  }

  for(i=0;i<r+1;i++){
    for(j=0;j<c+1;j++){
      printf("%d",array[i][j]);
      if(i!=r){
	array[r][j]+=array[i][j];
	printf("%d ",array[i][j]);
      }
    printf("\n");
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C

#include <stdio.h>
 
int main(void) {
 
	// ??????????????\????????????2????????°?????\???????????°
	int line, column;
	scanf("%d %d", &line, &column);
	
	// ???????????????????????????
	int grid[line+1][column+1];
	
	for(int cnt1 = 0; cnt1 <= line; cnt1++) {
	  
	  for(int cnt2 = 0; cnt2 <= column; cnt2++) {
	    
	    grid[cnt1][cnt2] = 0;
	  }
	}
	
	// ????????????????????\??????
	for(int cnt1 = 0; cnt1 <= line; cnt1++) {
		
		if(cnt1 < line) {
			
			for(int cnt2 = 0; cnt2 <= column; cnt2++) {
				
				if(cnt2 < column) {
				
					scanf("%d", &grid[cnt1][cnt2]);
					printf("%d ", grid[cnt1][cnt2]);
					
					// ??????????????????????????????????¨??????\??????
					grid[cnt1][column] += grid[cnt1][cnt2];
					
					// ??????????????????????????????????¨??????\??????
					grid[line][cnt2] += grid[cnt1][cnt2];
				
				// ??????????¨??????????	
				} else {
					
					printf("%d\n", grid[cnt1][cnt2]);
					grid[line][column] += grid[cnt1][cnt2];
				}
			}
			
		} else {
			
			for(int cnt2 = 0; cnt2 <= column; cnt2++) {
			  
			  if(cnt2 != column) {
				
				printf("%d ", grid[cnt1][cnt2]);
				
			} else {
			  
			  printf("%d\n", grid[cnt1][cnt2]);
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:61:1: error: expected declaration or statement at end of input
   61 | }
      | ^
Language: C

#include <stdio.h>

int main(){
  int r, c;
  scanf("%d %d", &r, &c);

  /*表生成と初期化*/
  int table[r + 1][c + 1];

  for(int row = 0; i <= r; i++){
	for(int column = 0; j <= c; j++){
	  table[i][j] = 0;
	}
  }

  /*値の読み込み*/
  for(int row = 0; i < r; i++){
	for(int column = 0; j < c; j++){
	  scanf("%d", &table[i][j]);
	}
  }

  /*行の集計*/
  for(int row = 0; i < r; i++){
	for(int column = 0; j < c; j++){
	  table[i][c] += table[i][j];
	}
  }

  /*列の集計*/
  for(int column = 0; i <= c ; i++){
	for(int row = 0; j < r; j++){
	  table[r][i] += table[j][i];
	}
  }

  /*表の表示*/
  for(int row = 0; i <= r; i++){
	for(int column = 0; j <= c; j++){
	  printf("%d",table[i][j]);
	  if(j != c){printf(" ");}
	}
	printf("\n");
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:20: error: 'i' undeclared (first use in this function)
   10 |   for(int row = 0; i <= r; i++){
      |                    ^
main.c:10:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:29: error: 'j' undeclared (first use in this function)
   11 |         for(int column = 0; j <= c; j++){
      |                             ^
Language: C

#include <stdio.h>

int main(){
  int r, c;
  scanf("%d %d", &r, &c);

  /*表生成と初期化*/
  int table[r + 1][c + 1];

  for(int row = 0; row <= r; row++){
	for(int column = 0; column <= c; column++){
	  table[row][column] = 0;
	}
  }

  /*値の読み込み*/
  for(int row = 0; row < r; row++){
	for(int column = 0; column < c; column++){
	  scanf("%d", &table[row][column]);
	}
  }

  /*行の集計*/
  for(int row = 0; row < r; row++){
	for(int column = 0; column < c; column++){
	  table[row][c] += table[row][column];
	}
  }

  /*列の集計*/
  for(int column = 0; column <= c ; column++){
	for(int row = 0; row < r; row++){
	  table[r][column] += table[row][column];
	}
  }

  /*表の表示*/
  for(int row = 0; row <= r; row++){
	for(int column = 0; column <= c; column++){
	  printf("%d",table[row][column]);
	  if(j != c){printf(" ");}
	}
	printf("\n");
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:41:14: error: 'j' undeclared (first use in this function)
   41 |           if(j != c){printf(" ");}
      |              ^
main.c:41:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

int main()
{
	int r, c, num, sum;

	scanf("%d %d", &r, &c);
	for (int i = 0; i < r;i++) {
		sum = 0;
		for (int j = 0; j < c; j++) {
			scanf("%d ", &num);
			sum += num;
			printf("%d ", num);
		}
		print("%d\n", sum);
	}

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:17: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |                 print("%d\n", sum);
      |                 ^~~~~
      |                 printf
Language: C

#include <stdio.h>
 
 
int main(void)
{
  int r, c;
  scanf("%d %d", &r, &c );
   
  int a[r+1][c+1];
  int i, j;
   
  for( j = 0; j <= c; j++ ){
    a[r][j] = 0;
  }
   
  for( i = 0; i < r; i++ ){
    a[i][c] = 0;
    for( j = 0; j < c; j++ ){
      scanf("%d", &a[i][j] );
      a[i][c] += a[i][j];
      a[r][j] += a[i][j];
    }
     
    a[r][c] += a[i][c];
  }


Compiler output:
main.c: In function 'main':
main.c:25:3: error: expected declaration or statement at end of input
   25 |   }
      |   ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:10:26: error: 'tablr' undeclared (first use in this function); did you mean 'table'?
   10 |        for(j=0;j<=c;j++) tablr[i][j]=0;
      |                          ^~~~~
      |                          table
main.c:10:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
    int r,c;
    scanf("%d%d",&r,&c);
    int i,j,k,l;
    int a[101][101]={};
    
    
    
    for(i=0;i<r;i++)
        for(j=0;j<c;j++)
            scanf("%d",&a[i][j]);
    
    //a[r][k]=a[0][k]+a[1][k]+...a[r-1][k]    a[j][k]
    //a[l][c]=a[l][0]+a[l][1]+...a[l][c-1]    a[l][j]
    
    for(k=0;k<c;k++)
        for(j=0;j<r;j++)
            a[r][k]+=a[j][k];
    for(l=0;l<r+1;l++)
        for(i=0;i<c;i++)
            a[l][c]+=a[l][i];
    

    for(i=0;i<r+1;i++){
        printf("%d",a[i][0]);
        for(j=1;j<c+1;j++)
            printf(" %d",a[i][j]);
        printf("\n");
        }
    


Compiler output:
main.c: In function 'main':
main.c:30:9: error: expected declaration or statement at end of input
   30 |         }
      |         ^
Language: C

#include <iostream>
using namespace std;

int main(){
  int T[101][101], r, c;
  
  cin >> r >> 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++) 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[j][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:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(void){
  int r, c;
  int sum = 0;
  scanf("%d %d\n", &r, &c);
  int a[r+1][c+1] = {{}};
  for(int i=0; i<r; i++){
    for(int j=0; j<c; j++){
        scanf("%d\n", &a[i][j]);
      }
    }

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

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

  a[r][c] = sum;

  for(int i=0; i<=r; i++){
    for(int j=0; j<=c; j++){
      printf("%d\n", &a[i][j]);
    }
  }

  }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:21: error: variable-sized object may not be initialized except with an empty initializer
    7 |   int a[r+1][c+1] = {{}};
      |                     ^
main.c: At top level:
main.c:34:3: error: expected identifier or '(' before 'return'
   34 |   return 0;
      |   ^~~~~~
main.c:35:1: error: expected identifier or '(' before '}' token
   35 | }
      | ^
Language: C

#include <stdio.h>

int main(){
  int A[101][101],r,c,i,j,sum,total=0;

  scanf("%d%d",&r,&c);

  for (i=0; i<r; i++) for (j=0; j<c; j++) scanf("%d",&A[i][j]);

  for (i=0; i<r; i++){
    sum=0;
    for (j=0; j<c; j++){
      sum += A[i][j];
      total = A[i][j];
    }
    A[i][j] = sum;
  }
  for (j=0; j<c; j++){
    sum = 0;
    for (i=0; i<r; i++){
      sum += A[i][j];
    }
    A[i][j] = sum ;
  }
  A[i][j] = total;
  for (i=o; i<r; i++){
    for (j=0; j<c; j++){
      printf("%d\n",A[i][j]);
  }
    printf("%d",A[i][j]);
  }
  
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:26:10: error: 'o' undeclared (first use in this function)
   26 |   for (i=o; i<r; i++){
      |          ^
main.c:26:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
 int r,c;
 int i,j;
 int mat[100][100]={{}};
 scanf("%d %d",&r,&c); /*r=行、c=列*/
  for(i=0;i<r;i++){
    for(j=0;j<c;j++){
      scanf("%d",mat[i][j]);
    }
  }
  for(i=0;i<c;i++){
    for(j=0;j<r;j++){
      mat[i][c+1]+=mat[i][j];
    }
  }
  for(i=0;i<c;i++){
    for(j=0;j<=r;j++){
      printf("%d",mat[i][j])
    }
    printf("\n");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:29: error: expected ';' before '}' token
   19 |       printf("%d",mat[i][j])
      |                             ^
      |                             ;
   20 |     }
      |     ~
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:
main.c: In function 'main':
main.c:5:9: error: 'cin' undeclared (first use in this function)
    5 |         cin >> r >> c;
      |         ^~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:23: error: 'new' undeclared (first use in this function)
    7 |         int **table = new int*[r+1];
      |                       ^~~
main.c:7:27: error: expected ',' or ';' before 'int'
    7 |         int **table = new int*[r+1];
      |                           ^~~
main.c:9:31: error: expected ';' before 'int'
    9 |                 table[i] = new int[c+1];
      |                               ^~~~
      |                               ;
main.c:26:25: error: 'cout' undeclared (first use in this function)
   26 |                         cout << table[i][j];
      |                         ^~~~
main.c:29:25: error: 'endl' undeclared (first use in this function)
   29 |                 cout << endl;
      |                         ^~~~
Language: C

#include<iostream>
#include<vector>
#define rep(i,a) for(int i = 0; i < a; i++)
using namespace std;

int main(){
	int r, c;
	int array[100][100];
	cin >> r >> c;
	rep(i, r){
		rep(j, c){
			cin >> array[i][j];
		}
	}
	//縦横の計算
	rep(i, r){
		rep(j, c){
			array[i][c] += array[i][j];
			array[r][j] += array[i][j];
		}
	}
	//右下の計算
	rep(i , c){
		array[r][c] += array[r][i];
	}

	//出力結果
	rep(i, r+1){
		rep(j, c+1){
			cout << array[i][j];
			if(j != c) cout << " ";
		}
	cout << endl;
	}

}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int r ,c;
			r = scan.nextInt();
			c = scan.nextInt();
			int[][] matrix = new int[r + 1][c + 1];
			for(int i = 0; i < r ;i++){
				for(int j = 0 ; j < c;j++){
					matrix[i][j] = scan.nextInt();
				}
			}
			for(int i = 0 ;i < r;i++){
				int sum = 0;
				for(int j = 0; j < c;j++){
					sum += matrix[i][j];
				}
				matrix[i][c] = sum;
			}
			for(int i = 0 ; i <= c;i++){
				int sum = 0;
				for(int j = 0 ; j < r; j++){
					sum += matrix[j][i];
				}
				matrix[r][i] = sum;
			}
			for(int i = 0 ; i < matrix.length;i++){
				System.out.print(matrix[i][0]);
				for(int j = 1 ; j < matrix[i].length;j++){
					System.out.print(" " + matrix[i][j]);
				}
				System.out.println();
			}
		}finally{
			if(scan !=null)scan.close();
		}
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Main{
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    3 | public class Main{
      |              ^~~~
Language: C

#include <iostream>
using namespace std;
int main(){
  int r,c,m,n,data[101][101];

  cin>>r>>c;

  for(m=0; m<101; m++)for(n=0; n<101; n++)data[m][n]=0;

  for(m=0; m<r; m++)for(n=0; n<c; n++)cin>>data[m][n];

  for(m=0; m<r; m++){

    for(n=0; n<c; n++)cout<<data[m][n]<<" ";

    for(n=0; n<c; n++)data[m][c]+=data[m][n];
    cout<<data[m][c];

    cout<<"\n";

  }

  for(n=0; n<c+1; n++){

    for(m=0; m<r; m++)data[r][n]+=data[m][n];

    cout<<data[r][n];
    if(n==c)break;
    else cout<<" ";

      }

  cout<<"\n";

}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
int main(){
    int A,r,c;
    cin >> r >> c;
    hyo[100][100]={};
    newer[r+c+1]={};
    for(int i=0;i<r;i++){
    	for(int j=0;j<c;j++){
    		cin >> A;
    		hyo[i][j]=A;
    	}
    }
    for(int i=0;i<r;i++){
    	for(int j=0;j<c;j++){
    		newer[i]+=hyo[i][j];
    	}
    }
    for(int j=0;j<c;j++){
    	for(int i=0;i<r;i++){
    		newer[j+r]+=hyo[j][i];
    		newer[r+c+1]+=newer[j+r]
    	}
    }
    for(int i=0;i<r;i++){
    	for(int j=0;j<c+1;j++){
    		if(j<c){
    			cout << hyo[i][j] << " " ;
    		}
    		else if(j==c){
    			cout << newer[1] << endl;
    		}
    	}
    }
    for(int i=0;i<c+1;i++){
    	if(i<c){
              cout << newer[i+r] << " ";
    	}
    	else if(i==c){
              cout << newer[r+c+1];
    	}
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'hyo' was not declared in this scope
    6 |     hyo[100][100]={};
      |     ^~~
a.cc:7:5: error: 'newer' was not declared in this scope
    7 |     newer[r+c+1]={};
      |     ^~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: no match for 'operator[]' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
    7 |        for(int j=0;j<r;j++)cin[i][j];
      |                               ^
Language: C++

#include <iostream>

using namespace std;

int main() {
  int array[101][101] = {0};
  int r, c;
  cin >> r >> c;
  for(int y=0; y < r; ++y){
    for(int x=0; x < c; ++x){
      cin >> array[y][x];
      array[100][x] += array[y][x];
      array[y][100] += array[y][x];
    }
  }
  for(int x=0; y < c; ++x){
    array[100][100] += array[r][x];
  }
  for(int y=0; y < r; ++y){
    for(int x=0; x < c; ++x){
      cout << array[y][x] << ' ';
    }
    cout << array[y][100];
    cout << endl;
  }
  for(int x=0; x < c; ++x){
    cout << array[100][x] << ' ';
  }
  cout << array[100][100] << endl;
  return 0;
}


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

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

int main()
{
	int r, c;
	cin >> r >> c;
	vector<vector<int>> m(r, vector<int>(c));
	for (auto &v : m)
		for (auto &x : v)
			cin >> x;
	for (auto &v : m)
		v.push_back(accumulate(v.begin(), v.end(), 0));
	m.push_back(vector<int>(c + 1));
	for (int j = 0; j <= c; j++)
		m.back()[j] = accumulate(m.begin(), m.end(), 0, [i](int s, auto v) {return s + v[j]; });
	for (int i = 0; i <= r; i++)
		for (int j = 0; j <= c; j++)
			cout << m[i][j] << (j == c ? '\n' : ' ') << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:66: error: 'i' was not declared in this scope
   18 |                 m.back()[j] = accumulate(m.begin(), m.end(), 0, [i](int s, auto v) {return s + v[j]; });
      |                                                                  ^
a.cc: In lambda function:
a.cc:18:98: error: 'j' is not captured
   18 |                 m.back()[j] = accumulate(m.begin(), m.end(), 0, [i](int s, auto v) {return s + v[j]; });
      |                                                                                                  ^
a.cc:18:67: note: the lambda has no capture-default
   18 |                 m.back()[j] = accumulate(m.begin(), m.end(), 0, [i](int s, auto v) {return s + v[j]; });
      |                                                                   ^
a.cc:17:18: note: 'int j' declared here
   17 |         for (int j = 0; j <= c; j++)
      |                  ^
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_numeric.h: In instantiation of '_Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation) [with _InputIterator = __gnu_cxx::__normal_iterator<vector<int>*, vector<vector<int> > >; _Tp = int; _BinaryOperation = main()::<lambda(int, auto:1)>]':
a.cc:18:27:   required from here
   18 |                 m.back()[j] = accumulate(m.begin(), m.end(), 0, [i](int s, auto v) {return s + v[j]; });
      |                               ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:169:29: error: void value not ignored as it ought to be
  169 |         __init = __binary_op(_GLIBCXX_MOVE_IF_20(__init), *__first);
      |                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
using namespace std;

int main(){
    int r,c;
    scanf("%d%d",&r,&c);
    int matrix[101][101]={};
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){
            scanf("%d",&matrix[i][j])
            matrix[i][c+1] += matrix[i][j]
            matrix[r+1][j] += matrix[i][j]
        }
    }
    for(int i=0;i<r+1;i++){
        for(int j=0;j<c+1;j++){
            printf("&d ",matrix[i][j])
        }printf("\n")
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: expected ';' before 'matrix'
   10 |             scanf("%d",&matrix[i][j])
      |                                      ^
      |                                      ;
   11 |             matrix[i][c+1] += matrix[i][j]
      |             ~~~~~~                    
a.cc:17:39: error: expected ';' before '}' token
   17 |             printf("&d ",matrix[i][j])
      |                                       ^
      |                                       ;
   18 |         }printf("\n")
      |         ~                              
a.cc:18:22: error: expected ';' before '}' token
   18 |         }printf("\n")
      |                      ^
      |                      ;
   19 |     }
      |     ~
Language: C++

#coding: UTF-8

r, c = map(int, input().split())
list = [[0 for i in range(r+1)] for j in range(c+1)]

a = [input().split() for k in range(c)]

for l in range(r):
    for m in range(c):
        list[l][c] += int(a[l][m])
        list[r][m] += int(a[l][m])
        list[l][m] = int(a[l][m])

for n in range(r):
    list[r][c] += int(a[n][c-1])

print(list)


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #coding
    1 | #coding: UTF-8
      |  ^~~~~~
a.cc:3:1: error: 'r' does not name a type
    3 | r, c = map(int, input().split())
      | ^
Language: C++

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

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'lon' was not declared in this scope; did you mean 'long'?
    5 |         lon arr[101][101];
      |         ^~~
      |         long
a.cc:9:20: error: 'arr' was not declared in this scope
    9 |             cin >> arr[i][j];
      |                    ^~~
a.cc:13:9: error: 'arr' was not declared in this scope
   13 |         arr[r][c] += arr[i][c];
      |         ^~~
a.cc:18:21: error: 'arr' was not declared in this scope
   18 |             cout << arr[i][j];
      |                     ^~~
Language: C++

#include<iostream>
using nameplace std;
int main(){
    int table[101][101]={{}};
    int r, c, i, j, total;
    cin >> r >> c;
    for(i=1;i<=r;i++){
        for(j=1;j<=c;j++){
            cin >> table[i][j];
        }
    }
    for(i=1;i<=r;i++){
        total = 0;
        for(j=1;j<=c;j++){
            total += table[i][j];
        }
        table[i][j+1] = total;
    }
    
    for(j=1;j<=c+1;j++){
        total = 0;
        for(i=1;i<=r;i++){
            total += table[i][j];
        }
        table[i+1][j] = total;
    }
    
    for(i=1;i<=r+1;i++){
        cout << table[i][1];
        for(j=2;j<=c+1;j++){
            cout << " " << table[i][j];
        }
        cout << endl;
    }
    return 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nameplace'
    2 | using nameplace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin >> r >> c;
      |     ^~~
      |     std::cin
In file included 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:29:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |         cout << table[i][1];
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:33:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   33 |         cout << endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <stdio.h>

int main (void){

  int r,c,i,j,k,l;
  scanf("%d %d",&r,&c);
  int H [101][101] = {};

  for (i = 0; i < r; i++){
    for (j = 0; j < c; j++){
      scanf("%d",&H[i][j]);
    }
  }
  for (i = 0; i <= r; i++){
    for (j = 0; j <= c; j++){
      H[r][j] += H[i][j];
      H[i][c] += H[i][j];
      if (j == c){
          printf("%d\n",a[i][j]);
      }else {printf("%d ",a[i][j]);
      }
    }
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'a' was not declared in this scope
   19 |           printf("%d\n",a[i][j]);
      |                         ^
a.cc:20:27: error: 'a' was not declared in this scope
   20 |       }else {printf("%d ",a[i][j]);
      |                           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c,t;
    int t=0;
    cin>>r>>c;
    int R[c+1]={};
    for (int i=0;i<r;i++){
        for(int x=0;x<c;x++){
            cin>>R[x];
            cout<<R[x]<<" ";
        }
        for(int x=0;x<c;x++){
            t+=R[x];
        }
    cout<<t<<endl;
    R[c+1]={};
    t=0;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: redeclaration of 'int t'
    5 |     int t=0;
      |         ^
a.cc:4:13: note: 'int t' previously declared here
    4 |     int r,c,t;
      |             ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c,t;
    t=0;
    cin>>r>>c;
    int R[c+1]={};
    int S[c+1]={};
    for (int i=0;i<r;i++){
        for(int x=0;x<c;x++){
            cin>>R[x];
            cout<<R[x]<<" ";
        }
        for(int x=0;x<c;x++){
            S[i}=R[x];
        }
    cout<<t<<endl;
    R[c+1]={};
    t=0;
    }
    for(int x=0;x<c;x++){
        cout<<S[x]<<" ";
    }
    cout<<S[c}<<endl;    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected ']' before '}' token
   15 |             S[i}=R[x];
      |                ^
      |                ]
a.cc:15:16: error: expected ';' before '}' token
   15 |             S[i}=R[x];
      |                ^
      |                ;
a.cc:15:17: error: expected primary-expression before '=' token
   15 |             S[i}=R[x];
      |                 ^
a.cc:15:20: error: 'x' was not declared in this scope
   15 |             S[i}=R[x];
      |                    ^
a.cc: At global scope:
a.cc:21:5: error: expected unqualified-id before 'for'
   21 |     for(int x=0;x<c;x++){
      |     ^~~
a.cc:21:17: error: 'x' does not name a type
   21 |     for(int x=0;x<c;x++){
      |                 ^
a.cc:21:21: error: 'x' does not name a type
   21 |     for(int x=0;x<c;x++){
      |                     ^
a.cc:24:5: error: 'cout' does not name a type
   24 |     cout<<S[c}<<endl;
      |     ^~~~
a.cc:24:14: error: expected declaration before '}' token
   24 |     cout<<S[c}<<endl;
      |              ^
a.cc:24:15: error: expected unqualified-id before '<<' token
   24 |     cout<<S[c}<<endl;
      |               ^~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c,t;
    t=0;
    cin>>r>>c;
    int R[c+1]={};
    int S[c+1]={};
    for (int i=0;i<r;i++){
        for(int x=0;x<c;x++){
            cin>>R[x];
            cout<<R[x]<<" ";
        }
        for(int x=0;x<c;x++){
            S[i]=R[x];
        }
    cout<<t<<endl;
    R[c+1]={};
    t=0;
    }
    for(int x=0;x<c;x++){
        cout<<S[x]<<" ";
    }
    cout<<S[c}<<endl;    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: expected ']' before '}' token
   24 |     cout<<S[c}<<endl;
      |              ^
      |              ]
a.cc:24:14: error: expected ';' before '}' token
   24 |     cout<<S[c}<<endl;
      |              ^
      |              ;
a.cc: At global scope:
a.cc:24:15: error: expected unqualified-id before '<<' token
   24 |     cout<<S[c}<<endl;
      |               ^~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c,sum,total;
    total=0;
    int lst[r][c];
    for (int a=0;a<r;a++){
        sum=0;
        for (int b=0;b<c;b++){
            int num;
            cin>>num;
            lst[a][b]=num;
            cout<<num<<" ";
            sum=sum+num
        }
        cout<<sum<<endl;
    }for(int d=0;d<c;;d++){
        sum=0;
        for (int e=0;e<r;e++){
            sum=sum+lst[e][d];
            total=total+lst[e][d];
        }cout<<sum<<" ";
    }cout<<total<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: expected ';' before '}' token
   14 |             sum=sum+num
      |                        ^
      |                        ;
   15 |         }
      |         ~               
a.cc:17:22: error: expected primary-expression before ';' token
   17 |     }for(int d=0;d<c;;d++){
      |                      ^
a.cc:17:22: error: expected ')' before ';' token
   17 |     }for(int d=0;d<c;;d++){
      |         ~            ^
      |                      )
a.cc:17:23: error: 'd' was not declared in this scope
   17 |     }for(int d=0;d<c;;d++){
      |                       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c,sum,total;
    total=0;
    int lst[r][c];
    for (int a=0;a<r;a++){
        sum=0;
        for (int b=0;b<c;b++){
            int num;
            cin>>num;
            lst[a][b]=num;
            cout<<num<<" ";
            sum=sum+num;
        }
        cout<<sum<<endl;
    }for(int d=0;d<c;;d++){
        sum=0;
        for (int e=0;e<r;e++){
            sum=sum+lst[e][d];
            total=total+lst[e][d];
        }cout<<sum<<" ";
    }cout<<total<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: expected primary-expression before ';' token
   17 |     }for(int d=0;d<c;;d++){
      |                      ^
a.cc:17:22: error: expected ')' before ';' token
   17 |     }for(int d=0;d<c;;d++){
      |         ~            ^
      |                      )
a.cc:17:23: error: 'd' was not declared in this scope
   17 |     }for(int d=0;d<c;;d++){
      |                       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r, c,;
    int S = 0;
    
    cin >> r >> c;
    
    int dim[r + 1][c + 1] = {};
    
    for(int i = 0; i < r; i++){
        for(int j = 0; j < c; j++){
            cin >> dim[i][j];
            
            dim[i][c] += dim[i][j];
        }
        
    }
    
    for(int i = 0; i < r; i++){
        for(int j = 0; j < c; j++){
            cout << dim[i][j] << " ";
        }
        
        cout << dim[i][c] << endl;
    }
    
    for(int i = 0; i < c; i++){
        for(int j = 0; j < r; j++){
            dim[r][i] += dim[i][j];
        }
        
        S += dim[r][c];
        
        cout << dim[r][i] << " ";
    }
    
    cout << S << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: expected unqualified-id before ';' token
    4 |     int r, c,;
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r, c;
    int S = 0;
    
    cin >> r >> c;
    
    int dim[r + 1][c + 1];
    
    for(int i = 0; i =< r; i++){
        dim[i][c] = 0;
    }
    
    for(int j = 0; j =< c; j++){
        dim[r][j] = 0;
    }
    
    for(int i = 0; i < r; i++){
        for(int j = 0; j < c; j++){
            cin >> dim[i][j];
            
            dim[i][c] += dim[i][j];
        }
        
    }
    
    for(int i = 0; i < r; i++){
        for(int j = 0; j < c; j++){
            cout << dim[i][j] << " ";
        }
        
        cout << dim[i][c] << endl;
    }
    
    for(int i = 0; i < c; i++){
        for(int j = 0; j < r; j++){
            dim[r][i] += dim[i][j];
        }
        
        S += dim[r][c];
        
        cout << dim[r][i] << " ";
    }
    
    cout << S << endl;
    
}


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

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'c' was not declared in this scope
    8 |     cin>>r>>c;
      |             ^
a.cc:19:17: error: expected ']' before ';' token
   19 |         A[r][j=0;]
      |                 ^
      |                 ]
a.cc:19:18: error: expected primary-expression before ']' token
   19 |         A[r][j=0;]
      |                  ^
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: expected ']' before ';' token
   19 |         A[r][j=0;]
      |                 ^
      |                 ]
a.cc:19:18: error: expected primary-expression before ']' token
   19 |         A[r][j=0;]
      |                  ^
Language: C++

int r,c,a;  //ｒが行（横）ｃが列（縦）
    cin >> r >> c;
    int spreadsheet[r][c];
    int total1 = 0,total2 = 0,sumyoko = 0;
    
    
    
    for(int i = 0; i < r; i++){
        
        for(int j = 0; j < c;j++){
            cin >> a;
            spreadsheet[i][j] = a;
        }
    }
    
    for(int k = 0; k<r;k++){  //横の列の合計を出す   
        
        for(int l = 0; l < c;l++){
            cout << spreadsheet[k][l] << " ";
            total1 += spreadsheet[k][l];
            sumyoko += spreadsheet[k][l]; 
        }
        cout << total1 << endl;
        total1 = 0;
        
    }
    //cout << endl;
    
    
    
    int q = 0;
    while(q < c){   //縦の列の合計を出す。
        
        for(int p = 0; p < r;p++){
            total2 += spreadsheet[p][q];
            //cout << spreadsheet[p][q] << " ";
        }
        cout << total2 << " ";
        q += 1;
        total2 = 0;
    }
    
    cout << sumyoko << endl;

    
}


Compiler output:
a.cc:2:5: error: 'cin' does not name a type
    2 |     cin >> r >> c;
      |     ^~~
a.cc:3:24: error: size of array 'spreadsheet' is not an integral constant-expression
    3 |     int spreadsheet[r][c];
      |                        ^
a.cc:3:21: error: size of array 'spreadsheet' is not an integral constant-expression
    3 |     int spreadsheet[r][c];
      |                     ^
a.cc:8:5: error: expected unqualified-id before 'for'
    8 |     for(int i = 0; i < r; i++){
      |     ^~~
a.cc:8:20: error: 'i' does not name a type
    8 |     for(int i = 0; i < r; i++){
      |                    ^
a.cc:8:27: error: 'i' does not name a type
    8 |     for(int i = 0; i < r; i++){
      |                           ^
a.cc:16:5: error: expected unqualified-id before 'for'
   16 |     for(int k = 0; k<r;k++){  //横の列の合計を出す
      |     ^~~
a.cc:16:20: error: 'k' does not name a type
   16 |     for(int k = 0; k<r;k++){  //横の列の合計を出す
      |                    ^
a.cc:16:24: error: 'k' does not name a type
   16 |     for(int k = 0; k<r;k++){  //横の列の合計を出す
      |                        ^
a.cc:32:5: error: expected unqualified-id before 'while'
   32 |     while(q < c){   //縦の列の合計を出す。
      |     ^~~~~
a.cc:43:5: error: 'cout' does not name a type
   43 |     cout << sumyoko << endl;
      |     ^~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

#include<stdio.h>

int main(){
    int r,c;
    scanf("%d %d",&r,&c);
    int table[r+1][c+1] = {};
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c;j++){
            scanf("%d",&table[i][j]);
            table[r][ij] += table[i][j]
        }
    }
    
    for(int i = 0;i < r+1;i++){
        for(int j = 0;j < c+1;j++){
            if(j != c){
                printf("%d ",table[i][j]);
            } else {
                printf("%d\n",table[i][j]);
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'ij' was not declared in this scope; did you mean 'j'?
   10 |             table[r][ij] += table[i][j]
      |                      ^~
      |                      j
Language: C++

#include<stdio.h>

int main(){
    int r,c;
    scanf("%d %d",&r,&c);
    int table[r+1][c+1] = {};
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c;j++){
            scanf("%d",&table[i][j]);
            table[r][ij] += table[i][j];
        }
    }
    
    for(int i = 0;i < r+1;i++){
        for(int j = 0;j < c+1;j++){
            if(j != c){
                printf("%d ",table[i][j]);
            } else {
                printf("%d\n",table[i][j]);
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'ij' was not declared in this scope; did you mean 'j'?
   10 |             table[r][ij] += table[i][j];
      |                      ^~
      |                      j
Language: C++

#include<stdio.h>

int main(){
    int r,c;
    scanf("%d %d",&r,&c);
    int table[r+1][c+1] = {};
    for(int i = 0;i < r;i++){
        for(int j = 0;j < c;j++){
            scanf("%d",&table[i][j]);
            table[r][j] += table[i][j];
            table[i][c] += table[i][j]
        }
    }
    
    for(int i = 0;i < r+1;i++){
        for(int j = 0;j < c+1;j++){
            if(j != c){
                printf("%d ",table[i][j]);
            } else {
                printf("%d\n",table[i][j]);
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:39: error: expected ';' before '}' token
   11 |             table[i][c] += table[i][j]
      |                                       ^
      |                                       ;
   12 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: expected ';' before '}' token
   33 |             z[i] += x[i][j]
      |                            ^
      |                            ;
   34 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: expected ';' before '}' token
   33 |             z[i] += x[i][j]
      |                            ^
      |                            ;
   34 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: expected ';' before '}' token
   33 |             z[i] += x[j][i]
      |                            ^
      |                            ;
   34 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;
int main () {
    int r,c;
    
    cin >> r >> c;
    
    int mat[101][101];
    
    for (int i = 0; i > r; i ++) {
        
        for (int j = 0; j > c; j ++) {
            
            cin >> mat[i][j];
            
            mat[r][j] += mat[i][j];
            
            mat[i][c] += mat[i][j];
            
            mat[r][c] += mat[i][j];
            
            
        }
    }
    
    for (int i = 0; i > r; i ++) {
        
        for (int j = 0; j > c-1; j ++) {
            
            cout << mat[i][j] << ' ';
            
        }
        
        cout << mat[i][j] << endl;
        
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: 'j' was not declared in this scope
   34 |         cout << mat[i][j] << endl;
      |                        ^
Language: C++

#include<iostream>
using namespace std;
int main () {
    int r,c;
    
    cin >> r >> c;
    
    int mat[101][101];
    
    for (int i = 0; i > r; i ++) {
        
        for (int j = 0; j > c; j ++) {
            
            cin >> mat[i][j];
            
            mat[r][j] += mat[i][j];
            
            mat[i][c] += mat[i][j];
            
            mat[r][c] += mat[i][j];
            
            
        }
    }
    
    for (int k = 0; k > r; k ++) {
        
        for (int l = 0; l > c-1; l ++) {
            
            cout << mat[k][l] << ' ';
            
        }
        
        cout << mat[k][l] << endl;
        
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: 'l' was not declared in this scope
   34 |         cout << mat[k][l] << endl;
      |                        ^
Language: C++

#include<iostream>
using namespace std;
int main () {
    int r,c;
    
    cin >> r >> c;
    
    int mat[101][101];
    
    for (int i = 0; i > r; i ++) {
        
        for (int j = 0; j > c; j ++) {
            
            cin >> mat[i][j];
            
            mat[r][j] += mat[i][j];
            
            mat[i][c] += mat[i][j];
            
            mat[r][c] += mat[i][j];
            
            
        }
    }
    
    for (int k = 0; k > r; k ++) {
        
        for (int l = 0; l > c-1; l ++) {
            
            cout << mat[k][l] << ' ';
            
        }
        
        cout << mat[k][l] << endl
        
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: 'l' was not declared in this scope
   34 |         cout << mat[k][l] << endl
      |                        ^
Language: C++

#include<iostream>
using namespace std;
int main () {
    int r,c;
    
    cin >> r >> c;
    
    int mat[101][101];
    
    for (int i = 0; i > r; i ++) {
        
        for (int j = 0; j > c; j ++) {
            
            cin >> mat[i][j];
            
            mat[r][j] += mat[i][j];
            
            mat[i][c] += mat[i][j];
            
            mat[r][c] += mat[i][j];
            
            
        }
    }
    
    for (int k = 0; k > r; k ++) {
        
        for (int l = 0; l > c-1; l ++) {
            
            cout << mat[k][l] << ' '
            
        }
        
        cout << mat[k][l] << endl;
        
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:37: error: expected ';' before '}' token
   30 |             cout << mat[k][l] << ' '
      |                                     ^
      |                                     ;
   31 | 
   32 |         }
      |         ~                            
a.cc:34:24: error: 'l' was not declared in this scope
   34 |         cout << mat[k][l] << endl;
      |                        ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c;
    int rs[101]={}
    cin>>r>>c;
    int h[101][101];
    for(int i =0;i<=r;i++)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'cin'
    6 |     cin>>r>>c;
      |     ^~~
a.cc:9:1: error: expected primary-expression before '}' token
    9 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int r,c;
    int rs[101]={};
    int 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 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:7:5: error: expected ',' or ';' before 'cin'
    7 |     cin>>r>>c;
      |     ^~~
a.cc:15:12: error: 'i' was not declared in this scope
   15 |         if(i!=r){
      |            ^