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

#include <iostream>
#include <string>
#include <fstream>

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    cin >> data_set_num;
    //std::getline(std::cin,str);
    //sscanf(str.c_str(),"%d ",&data_set_num);

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |     cin >> data_set_num;
      |     ^~~
      |     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
      |                  ^~~
Language: C++

#include <iostream>
#include <string>
#include <fstream>

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    std::cin >> data_set_num;
    std::cin.ignore();

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::u_int pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'u_int' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   16 |         std::string::u_int pos = str.find(from);
      |                      ^~~~~
a.cc:17:15: error: 'pos' was not declared in this scope
   17 |         while(pos != std::string::npos){
      |               ^~~
Language: C++

#include <iostream>
#include <string>
#include <fstream>

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    std::cin >> data_set_num;
    std::cin.ignore();

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   16 |         std::string::size type pos = str.find(from);
      |                      ^~~~
a.cc:17:15: error: 'pos' was not declared in this scope
   17 |         while(pos != std::string::npos){
      |               ^~~
Language: C++

#include <iostream>
#include <sstream>
#include <vector>

int main(void){
	std::string tmp;
	u_int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore(); //delete cin buffer

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;
		std::string line; //outputted line data 

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}else if(tmo == "Hoshino."){
				tmp = "Hoshina.";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	if(it == (str.end() - 1)){
           		line = line + *it + "\0" ;
        	}else{
        		line = line + *it + " ";
        	}
        }
        std::cout << line << std::endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:34: error: 'tmo' was not declared in this scope; did you mean 'tmp'?
   23 |                         }else if(tmo == "Hoshino."){
      |                                  ^~~
      |                                  tmp
Language: C++

import string

n=int(input())

for i in range(n):
    print(input().replace("Hoshino", "Hoshina"))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import string
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <sstream>
#include <vector>
 
int main(void){
    int n; //number of data set
 
    std::cin >> n; //input number of data set
    std::cin.ignore(); //delete cin buffer
 
    for(size_t i = 0; i < n; ++i){
        std::vector<std::string> str; //string data
        std::string line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); it.next()){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:86: error: 'std::vector<std::__cxx11::basic_string<char> >::iterator' has no member named 'next'
   29 |         for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); it.next()){
      |                                                                                      ^~~~
Language: C++

n=int(input())
for i in range(n):
    s=input()
    for i in range(len(s)-7):
        if s[i:i+6]=='Hoshino':
            s[i+6]='a'

Compiler output:
a.cc:5:22: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
    5 |         if s[i:i+6]=='Hoshino':
      |                      ^~~~~~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

using System;

namespace TestProject
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			string s0 = "Hoshino";
			string s1 = "Hoshina";
			string[] s = new string[n];
			for (int i = 0; i < n; i++)
			{
				s[i] = Console.ReadLine();
				s[i] = s[i].Replace(s0, s1);
			}
			foreach (var x in s)
			{
				Console.WriteLine(x);
			}
		}
	}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:23: error: expected ':' before 'static'
    7 |                 public static void Main(string[] args)
      |                       ^~~~~~~
      |                       :
a.cc:7:41: error: 'string' has not been declared
    7 |                 public static void Main(string[] args)
      |                                         ^~~~~~
a.cc:7:50: error: expected ',' or '...' before 'args'
    7 |                 public static void Main(string[] args)
      |                                                  ^~~~
a.cc:23:10: error: expected ';' after class definition
   23 |         }
      |          ^
      |          ;
a.cc: In static member function 'static void TestProject::MainClass::Main(int*)':
a.cc:9:33: error: expected primary-expression before 'int'
    9 |                         int n = int.Parse(Console.ReadLine());
      |                                 ^~~
a.cc:10:25: error: 'string' was not declared in this scope
   10 |                         string s0 = "Hoshino";
      |                         ^~~~~~
a.cc:11:32: error: expected ';' before 's1'
   11 |                         string s1 = "Hoshina";
      |                                ^~
a.cc:12:32: error: expected primary-expression before ']' token
   12 |                         string[] s = new string[n];
      |                                ^
a.cc:15:33: error: 's' was not declared in this scope
   15 |                                 s[i] = Console.ReadLine();
      |                                 ^
a.cc:15:40: error: 'Console' was not declared in this scope
   15 |                                 s[i] = Console.ReadLine();
      |                                        ^~~~~~~
a.cc:16:53: error: 's0' was not declared in this scope
   16 |                                 s[i] = s[i].Replace(s0, s1);
      |                                                     ^~
a.cc:16:57: error: 's1' was not declared in this scope
   16 |                                 s[i] = s[i].Replace(s0, s1);
      |                                                         ^~
a.cc:18:34: error: 'var' was not declared in this scope
   18 |                         foreach (var x in s)
      |                                  ^~~
a.cc:18:25: error: 'foreach' was not declared in this scope
   18 |                         foreach (var x in s)
      |                         ^~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(){
    char s[2000];
    int n, i, j, key = 0;
    scanf("%c", &n);
    while( n-- ) {
        gets(s);
        for ( i = 0; i < strlen(s); i++ ) {
            if ( s[i] == 'H' ) {
                if ( s[i+1] == 'o' && s[i+2] == 's' && s[i+3] == 'h' && s[i+4] == 'i' && s[i+5] == 'n' && s[i+6] == 'o') {
                    s[i+6] = 'a';
                }
            }
        }
        printf("%s\n", s);
        key++;
    }    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <array>
#include <string>

int main(){
  int n;
  int i = 0;
  int flag = 0;
    std::array<std::string, 1000> str = {};

  std::cin >> n;

  while(n > 0){
    while(std::cin >> str[i]){
      ++flag;
        ++i;
    }
      for(int j = 0;j < flag;++j){
          if(str[j] == "Hoshino")
              str[j] = "Hoshina";
      }
      for(int j = 0;j < i;++j){
          std::cout << str[j];
      }
      std::cout << endl;
      
      flag = 0;
      i = 0;
      --n;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |       std::cout << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>

std::string false = "Hoshino";
std::string true = "Hoshina";

int main(){
	int num;
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.lemgth();j++){
			if(english[j]==false) english[j]=true;
		}
	}

    return 0;
}



Compiler output:
a.cc:4:13: error: expected unqualified-id before 'false'
    4 | std::string false = "Hoshino";
      |             ^~~~~
a.cc:5:13: error: expected unqualified-id before 'true'
    5 | std::string true = "Hoshina";
      |             ^~~~
a.cc: In function 'int main()':
a.cc:14:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lemgth'; did you mean 'length'?
   14 |                 for(int j=0;j<english.lemgth();j++){
      |                                       ^~~~~~
      |                                       length
Language: C++

#include <iostream>
#include <string>

std::string false = "Hoshino";
std::string true = "Hoshina";

int main(){
	int num;
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.lemgth();j++){
			if(english[j]==false) english[j]=true;
		}
		std::cout << english;
	}
    return 0;
}


Compiler output:
a.cc:4:13: error: expected unqualified-id before 'false'
    4 | std::string false = "Hoshino";
      |             ^~~~~
a.cc:5:13: error: expected unqualified-id before 'true'
    5 | std::string true = "Hoshina";
      |             ^~~~
a.cc: In function 'int main()':
a.cc:14:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lemgth'; did you mean 'length'?
   14 |                 for(int j=0;j<english.lemgth();j++){
      |                                       ^~~~~~
      |                                       length
Language: C++

#include <iostream>
#include <string>

std::string false = "Hoshino";
std::string true = "Hoshina";

int main(){
	int num;
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==false) english[j]=true;
		}
		std::cout << english;
	}
    return 0;
}


Compiler output:
a.cc:4:13: error: expected unqualified-id before 'false'
    4 | std::string false = "Hoshino";
      |             ^~~~~
a.cc:5:13: error: expected unqualified-id before 'true'
    5 | std::string true = "Hoshina";
      |             ^~~~
Language: C++

#include <iostream>
#include <string>

int main(){
	int num;
	std::string false = "Hoshino";
	std::string true = "Hoshina";
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==false) english[j]=true;
		}
		std::cout << english;
	}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before 'false'
    6 |         std::string false = "Hoshino";
      |                     ^~~~~
a.cc:7:21: error: expected unqualified-id before 'true'
    7 |         std::string true = "Hoshina";
      |                     ^~~~
Language: C++

#include <iostream>
#include <string>

int main(){
	int num;
	std::string false;
	std::string true;
	std::string english;
	std::cin >> num;

	false = "Hoshino";
	true = "Hoshina";
	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==false) english[j]=true;
		}
		std::cout << english;
	}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before 'false'
    6 |         std::string false;
      |                     ^~~~~
a.cc:7:21: error: expected unqualified-id before 'true'
    7 |         std::string true;
      |                     ^~~~
a.cc:11:17: error: lvalue required as left operand of assignment
   11 |         false = "Hoshino";
      |                 ^~~~~~~~~
a.cc:12:16: error: lvalue required as left operand of assignment
   12 |         true = "Hoshina";
      |                ^~~~~~~~~
Language: C++

#include <iostream>
#include <string>

int main(){
	int num;
	std::string fa = "Hoshino";
	std::string tr = "Hoshina";
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==false){
				if(english[j+7]==" "||english[j+7]=="\0")
					english[j]=true;
			}
		}
		std::cout << english;
	}
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:48: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                                 if(english[j+7]==" "||english[j+7]=="\0")
a.cc:15:67: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                                 if(english[j+7]==" "||english[j+7]=="\0")
Language: C++

#include <iostream>
#include <string>

int main(){
	int num;
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		while(english.find("Hoshino") != -1){
			int find = str.find("Hoshino");
			english.replace(find, find+6, "Hoshina");
		}
		std::cout << english;
	}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:36: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |                         int find = str.find("Hoshino");
      |                                    ^~~
      |                                    std
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;
  getline(cin, str);

  for(int i=0;i<line_length;++i){
    string input;
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'str' was not declared in this scope; did you mean 'std'?
    9 |   getline(cin, str);
      |                ^~~
      |                std
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int main(){
	int n, j;
	cin >> n;
	char s[1001];
	gets(s);
	for (int i = 0; i < n; i++) {
		//string s;
		//cin >> s;
		gets_s(s);
		for (j = 0; j < 1000-6; j++) {
			if (s[j + 6] == 0)
				break;
			if (s[j] == 'H'&&s[j + 1] == 'o'&&s[j + 2] == 's'&&s[j + 3] == 'h'&&s[j + 4] == 'i'&&s[j + 5] == 'n'&&s[j + 6] == 'o')
				s[j + 6] = 'a';
		}
		cout << s << endl;
		for (j += 5; j >= 0; j--) {
			s[j] = 0;
		}
	}
	

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets(s);
      |         ^~~~
      |         getw
a.cc:14:17: error: 'gets_s' was not declared in this scope
   14 |                 gets_s(s);
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int main(){
	int n, j;
	cin >> n;
	char s[1001];
	gets(s);
	for (int i = 0; i < n; i++) {
		//string s;
		//cin >> s;
		gets(s);
		for (j = 0; j < 1000-6; j++) {
			if (s[j + 6] == 0)
				break;
			if (s[j] == 'H'&&s[j + 1] == 'o'&&s[j + 2] == 's'&&s[j + 3] == 'h'&&s[j + 4] == 'i'&&s[j + 5] == 'n'&&s[j + 6] == 'o')
				s[j + 6] = 'a';
		}
		cout << s << endl;
		for (j += 5; j >= 0; j--) {
			s[j] = 0;
		}
	}
	

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner s=new Scanner (System.in);
		
		int n=s.nextInt();
		s.nextLine();
		for(int j=0;j<n;j++){
			char c[]=s.nextLine().toCharArray();
			for(int i=0;i<c.length-6;i++){
				if(c[i]=='H'&&c[i+1]=='o'&&c[i+2]=='s'&&c[i+3]=='h'&&c[i+4]=='i'&&c[i+5]=='n'&&c[i+6]=='o'){
					c[i+6]='a';
					i+=6;
				}
			}
			System.out.println(new String(c));
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String args[]){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String args[]){
      |                                 ^~~~~~
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'Scanner' was not declared in this scope
    5 |                 Scanner s=new Scanner (System.in);
      |                 ^~~~~~~
a.cc:7:23: error: 's' was not declared in this scope
    7 |                 int n=s.nextInt();
      |                       ^
a.cc:11:41: error: request for member 'length' in 'c', which is of non-class type 'char [1]'
   11 |                         for(int i=0;i<c.length-6;i++){
      |                                         ^~~~~~
a.cc:17:25: error: 'System' was not declared in this scope
   17 |                         System.out.println(new String(c));
      |                         ^~~~~~
a.cc:17:48: error: expected type-specifier before 'String'
   17 |                         System.out.println(new String(c));
      |                                                ^~~~~~
Language: C++

#include <stdio.h>
#include <string>

using namespace std;

int main(){
  int n;
  scanf("%d\n", &n);
  int i;
  for(i=0;i<n;i++){
    char str[1000];
    gets(str);
    string s(str);
    int index=0;
    while((index=s.find("Hoshino", index)) != string::npos)
      s.replace(index, 7, "Hoshina");

    printf("%s\n", (s.c_str()));
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |     gets(str);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int n, i, j, k, c, x;
	char s[1001], r[1001], t[8] = "Hoshino";
	cin >> n;
	cin.ignore(INT_MAX,'\n');
	for (i = 0; i < n; i++)
	{
		cin.getline(s, sizeof(s));
		c = 0;
		for (j = 0; j < strlen(s); j++)
		{
			r[c] = s[j];
			c++;
			if (s[j] == 'H')
			{
				for (k = j+1, x = 0; k < j+7; k++, c++)
				{
					if (s[k] == t[k-j])
					{
						if (k == j+6)
							r[c] = 'a';
						else
							r[c] = t[k-j];
						x++;
					}
					else
					{
						r[c] = s[k];
						break;
					}
				}
				j+=x;
			}
		}
		r[strlen(s)] = '\0';
		cout << r << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'INT_MAX' was not declared in this scope
    9 |         cin.ignore(INT_MAX,'\n');
      |                    ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <cstring>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void)
{
	string str;
	string::size_type index;
	int num;
	int number;
	int i,j;

	cin >> num;
	getline(cin,str);//ツ催渉可づ個づ「ツづつつセツつッツ禿づ敖債楪づ慊つケ
	for(i=0;i<num;i++)
	{
		getline(cin,str);
		number = 0;
		while((index = str.find("Hoshino") ) != string::npos)
		{
			str.replace(index,7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;

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

#include<iostream>#include<string>using namespace std;int main(){char ch;int n;cin>>n;cin.get(ch);for(int i=0;i<n;i++){string str;while(1){cin.get(ch);if(ch=='\n')break;str+=ch;}while(1){int idx=str.find("Hoshino");if(idx==-1)break;str[idx+6]='a';}cout<<str<<endl;}return 0;}

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include<iostream>#include<string>using namespace std;int main(){char ch;int n;cin>>n;cin.get(ch);for(int i=0;i<n;i++){string str;while(1){cin.get(ch);if(ch=='\n')break;str+=ch;}while(1){int idx=str.find("Hoshino");if(idx==-1)break;str[idx+6]='a';}cout<<str<<endl;}return 0;}
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int main()
{
	int n;

	cin >> n;
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: 'strlen' was not declared in this scope
   17 |                         s.replace( index, strlen("Hoshino"), "Hoshina" );
      |                                           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main()
{
	int n;

	cin >> n;
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: 'strlen' was not declared in this scope
   17 |                         s.replace( index, strlen("Hoshino"), "Hoshina" );
      |                                           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main()
{
	int n;

	cin >> n;
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( 1 ){
			index = s.find( "Hoshino", index );
			if( index == string::npos ) break;
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:43: error: 'strlen' was not declared in this scope
   19 |                         s.replace( index, strlen("Hoshino"), "Hoshina" );
      |                                           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main()
{
	int n;

	cin >> n;
	cin.clear();
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:43: error: 'strlen' was not declared in this scope
   18 |                         s.replace( index, strlen("Hoshino"), "Hoshina" );
      |                                           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main()
{
	int n;

	cin >> n;
	cin.get();

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: 'strlen' was not declared in this scope
   17 |                         s.replace( index, strlen("Hoshino"), "Hoshina" );
      |                                           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <cstdio>
#include <string>
 using namespace std;

int main()
{
    int WordQuantity = 0,totalcnt = 0,alf = 0;
    char Hoshino[8] = {"Hoshino"};
    char Hoshina[8] = {"Hoshina"};
    int n;
 
    scanf("%d",&n);
    fflush(stdin);
 
    for(int loop = 0; loop < n; loop++){
        char words[1000][1001];
        char text[1001];
        totalcnt = 0;
 
        gets(text);
        fflush(stdin);
 
        for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
            for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
                words[WordQuantity][alf] = text[totalcnt];
                totalcnt++;
            }
            words[WordQuantity][alf] = '\0';
            totalcnt++;
        }
 
        for(int i = 0; i < WordQuantity; i++){
            if(strcmp(words[i],Hoshino) == 0){
                strcpy(words[i],Hoshina);
            }
        }
 
        for(int i = 0; i < WordQuantity-1; i++){
            printf("%s ",words[i]);
        }
        printf("%s\n",words[WordQuantity-1]);
 
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   20 |         gets(text);
      |         ^~~~
      |         getw
a.cc:23:42: error: 'strlen' was not declared in this scope
   23 |         for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
      |                                          ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 |  using namespace std;
a.cc:33:16: error: 'strcmp' was not declared in this scope
   33 |             if(strcmp(words[i],Hoshino) == 0){
      |                ^~~~~~
a.cc:33:16: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:34:17: error: 'strcpy' was not declared in this scope
   34 |                 strcpy(words[i],Hoshina);
      |                 ^~~~~~
a.cc:34:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
using namespace std;

int main()
{
	int WordQuantity = 0,totalcnt = 0,alf = 0;
	char Hoshino[8] = {"Hoshino"};
	char Hoshina[8] = {"Hoshina"};
	int n;

	scanf("%d",&n);
	fflush(stdin);

	for(int loop = 0; loop < n; loop++){
		char words[1000][1001];
		char text[1001];
		totalcnt = 0;

		gets(text);
		fflush(stdin);

		for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
			for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
				words[WordQuantity][alf] = text[totalcnt];
				totalcnt++;
			}
			words[WordQuantity][alf] = '\0';
			totalcnt++;
		}

		for(int i = 0; i < WordQuantity; i++){
			if(strcmp(words[i],Hoshino) == 0){
				strcpy(words[i],Hoshina);
			}
		}

		for(int i = 0; i < WordQuantity-1; i++){
			printf("%s ",words[i]);
		}
		printf("%s\n",words[WordQuantity-1]);

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   20 |                 gets(text);
      |                 ^~~~
      |                 getw
a.cc:23:50: error: 'strlen' was not declared in this scope
   23 |                 for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
      |                                                  ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:33:28: error: 'strcmp' was not declared in this scope
   33 |                         if(strcmp(words[i],Hoshino) == 0){
      |                            ^~~~~~
a.cc:33:28: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:34:33: error: 'strcpy' was not declared in this scope
   34 |                                 strcpy(words[i],Hoshina);
      |                                 ^~~~~~
a.cc:34:33: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

int main(){
	int n;
	std::cin >> n;cin.get( );
	for(int i=0;i<n;i++){
		string s;
		getline(cin, s);
		for(int j=6;j<s.size();j++){
			if(s.substr(j-6,7)=="Hoshino"){
				s.at(j)='a';
			}
		}
		cout << s << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         std::cin >> n;cin.get( );
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:3:23: error: 'cin' was not declared in this scope
    3 |         std::cin >> n;cin.get( );
      |                       ^~~
a.cc:5:17: error: 'string' was not declared in this scope
    5 |                 string s;
      |                 ^~~~~~
a.cc:6:30: error: 's' was not declared in this scope
    6 |                 getline(cin, s);
      |                              ^
a.cc:6:17: error: 'getline' was not declared in this scope
    6 |                 getline(cin, s);
      |                 ^~~~~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << s << endl;
      |                 ^~~~
a.cc:12:30: error: 'endl' was not declared in this scope
   12 |                 cout << s << endl;
      |                              ^~~~
Language: C++

import java.util.*;
class Main{
  public static void main(String[]z){
    Scanner x=new Scanner(System.in);
    int n=x.nextInt();x.nextLine();
    for(;n>0;n--){
      String s=x.nextLine();
      System.out.println(s.replaceAll("Hoshino","Hoshina"));
    }
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:9: error: expected ':' before 'static'
    3 |   public static void main(String[]z){
      |         ^~~~~~~
      |         :
a.cc:3:27: error: 'String' has not been declared
    3 |   public static void main(String[]z){
      |                           ^~~~~~
a.cc:3:35: error: expected ',' or '...' before 'z'
    3 |   public static void main(String[]z){
      |                                   ^
a.cc:11:2: error: expected ';' after class definition
   11 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:5: error: 'Scanner' was not declared in this scope
    4 |     Scanner x=new Scanner(System.in);
      |     ^~~~~~~
a.cc:5:11: error: 'x' was not declared in this scope
    5 |     int n=x.nextInt();x.nextLine();
      |           ^
a.cc:7:7: error: 'String' was not declared in this scope
    7 |       String s=x.nextLine();
      |       ^~~~~~
a.cc:8:7: error: 'System' was not declared in this scope
    8 |       System.out.println(s.replaceAll("Hoshino","Hoshina"));
      |       ^~~~~~
a.cc:8:26: error: 's' was not declared in this scope
    8 |       System.out.println(s.replaceAll("Hoshino","Hoshina"));
      |                          ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(void)
{
	int ct;
	char *rp;
	char retu[1000],s[]="Hoshina";
	scanf_s("%d",&ct);
	fflush(stdin);
	for(int f1=0;f1<ct;f1++){
		gets_s(retu);
		while(1){
			if(strstr(retu,"Hoshino")==NULL){
				break;
			}
			if(rp=strstr(retu,"Hoshino")){
				rp+=6;
				*rp='a';
			}
		}
		printf("%s\n",retu);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d",&ct);
      |         ^~~~~~~
      |         scanf
a.cc:11:17: error: 'gets_s' was not declared in this scope
   11 |                 gets_s(retu);
      |                 ^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cin.ignore();
  string line;
  string s = "Hoshina";
  while((getline, line))
  {
  
    }
  cout<<"Hoshina"<<endl;
 cout<<"Hashino"<<endl;
 cout<<"Masayuki Hoshina was the grandson of Ieyasu Tokugawa."<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: left operand of comma operator cannot resolve address of overloaded function
   10 |   while((getline, line))
      |                   ^~~~
a.cc:10:17: error: could not convert '((void)0, line)' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   10 |   while((getline, line))
      |         ~~~~~~~~^~~~~~~
      |                 |
      |                 std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include<iostream>
#inlcude<string>
int main(){
	int a;
	std::cin>>a;
	for(int i=0;i<a+1;i++){
		std::string str;
		std::getline(std::cin,str);
		for(int j=0;j<str.size();j++){
			if(str[j]=='H'&&str[j+1]=='o'&&str[j+2]=='s'&&str[j+3]=='h'&&str[j+4]=='i'&&str[j+5]=='n'&&str[j+6]=='o'){
				str[j+6]='a';
			}
		}
		std::cout<<str<<std::endl;
	}
	
	return 0;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude<string>
      |  ^~~~~~~
      |  include
Language: C++

include <iostream>
using namespace std;

int main(void){

    int n;
    cin >> n;
    cin.ignore();

`   string text,s,ret;
    string str = "Hoshino";
    string astr = "Hoshina";

    for(int i = 0; i < n; ++i) {
        getline(cin, text);
        ret = text;
        for(int j = 0; j < text.length()-6; ++j) {
            s = text.substr(j,str.length());
            if (s.compare(str) == 0) {
                ret = text.replace(j, astr.length(), astr);
                break;
            }

        }

        cout << "ans: " << ret << endl;
    }

}

Compiler output:
a.cc:10:1: error: stray '`' in program
   10 | `   string text,s,ret;
      | ^
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n;
      |     ^~~
a.cc:10:5: error: 'string' was not declared in this scope
   10 | `   string text,s,ret;
      |     ^~~~~~
a.cc:11:11: error: expected ';' before 'str'
   11 |     string str = "Hoshino";
      |           ^~~~
      |           ;
a.cc:12:11: error: expected ';' before 'astr'
   12 |     string astr = "Hoshina";
      |           ^~~~~
      |           ;
a.cc:15:22: error: 'text' was not declared in this scope
   15 |         getline(cin, text);
      |                      ^~~~
a.cc:15:9: error: 'getline' was not declared in this scope
   15 |         getline(cin, text);
      |         ^~~~~~~
a.cc:16:9: error: 'ret' was not declared in this scope
   16 |         ret = text;
      |         ^~~
a.cc:18:13: error: 's' was not declared in this scope
   18 |             s = text.substr(j,str.length());
      |             ^
a.cc:18:31: error: 'str' was not declared in this scope; did you mean 'std'?
   18 |             s = text.substr(j,str.length());
      |                               ^~~
      |                               std
a.cc:20:39: error: 'astr' was not declared in this scope
   20 |                 ret = text.replace(j, astr.length(), astr);
      |                                       ^~~~
a.cc:26:9: error: 'cout' was not declared in this scope
   26 |         cout << "ans: " << ret << endl;
      |         ^~~~
a.cc:26:35: error: 'endl' was not declared in this scope
   26 |         cout << "ans: " << ret << endl;
      |                                   ^~~~
Language: C++

#include<iostream>
#include<string>

int main(){
	int n;
	char c;
	std::string str,Del;
	std::cin>>n;
	std::getline(std::cin,str);
	while( --n ,std::getline(std::cin,str) , n+1 ){
		int Result;
		while( (Result = str.find("Hoshino") ) != std::string::npos )str.replace(Result,strlen("Hoshino"),"Hoshina");
		std::cout<<str<<std::endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:97: error: 'strlen' was not declared in this scope
   12 |                 while( (Result = str.find("Hoshino") ) != std::string::npos )str.replace(Result,strlen("Hoshino"),"Hoshina");
      |                                                                                                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include <iostream>
#include <string>

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::string text;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        getline(std::cin, text);
        u_int index;
        
        while((index = text.find(str_false, index)) != string::npos)
            text.replace(index, str_false.size(), str_true);
        std::cout  << text << std::endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:56: error: 'string' has not been declared
   18 |         while((index = text.find(str_false, index)) != string::npos)
      |                                                        ^~~~~~
Language: Java


public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			if (n == 0)
				break;
			int[][] num = new int[n + 1][n + 1];
			for (int i = 0; i < n + 1; i++) {
				for (int j = 0; j < n + 1; j++) {
					if (i != n && j != n) {
						int a = scanner.nextInt();
						num[i][j] = a;
						num[i][n] += a;
						num[n][j] += a;
					} else if (i == n && j != n) {
						num[n][n] += num[n][j];
					}
					System.out.print(String.format("%5d", num[i][j]));
				}
				System.out.println();
			}
		}

	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

package main;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class MatrixLikeComputation {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int n = Integer.parseInt(br.readLine());
			if(n == 0){return;}
			int[][] array = new int[n][n];
			for(int i = 0;i<n;i++){
				String[] a = br.readLine().split(" ");
				for(int j = 0;j < n;j++){
					array[i][j]=Integer.parseInt(a[j]);
				}
			}
			int[][] result = makeNewArray(array);
			printArray(result);
			
		}
	}
	public static void printArray(int[][] array){
		for(int i=0;i<array.length;i++){
			for(int j = 0 ; j < array[0].length;j++){
				System.out.print(String.format("%1$5d", array[i][j]));
			}
			System.out.println("");
		}
	}
	
	public static int[][] makeNewArray(int[][] array){
		int[][] result =new int[array.length+1][array[0].length+1];
		for(int i = 0;i<array.length;i++){
			int sum = 0;
			for(int j = 0;j<array[0].length+1;j++){
				if(j < array[0].length){
					sum += array[i][j];
					result[i][j] = array[i][j];
				}else{
					result[i][j] = sum;
				}
			}
		}
		for(int j = 0;j < result[0].length;j++){
			int sum = 0;
			for(int i = 0; i < result.length;i++){
				if(i < result.length-1){
					sum+= result[i][j];
				}else{
					result[i][j] = sum;
				}
			}
		}
		return result;
	}

}

Compiler output:
Main.java:7: error: class MatrixLikeComputation is public, should be declared in a file named MatrixLikeComputation.java
public class MatrixLikeComputation {
       ^
1 error
Language: Java


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class MatrixLikeComputation {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int n = Integer.parseInt(br.readLine());
			if(n == 0){return;}
			int[][] array = new int[n][n];
			for(int i = 0;i<n;i++){
				String[] a = br.readLine().split(" ");
				for(int j = 0;j < n;j++){
					array[i][j]=Integer.parseInt(a[j]);
				}
			}
			int[][] result = makeNewArray(array);
			printArray(result);
			
		}
	}
	public static void printArray(int[][] array){
		for(int i=0;i<array.length;i++){
			for(int j = 0 ; j < array[0].length;j++){
				System.out.print(String.format("%1$5d", array[i][j]));
			}
			System.out.println("");
		}
	}
	
	public static int[][] makeNewArray(int[][] array){
		int[][] result =new int[array.length+1][array[0].length+1];
		for(int i = 0;i<array.length;i++){
			int sum = 0;
			for(int j = 0;j<array[0].length+1;j++){
				if(j < array[0].length){
					sum += array[i][j];
					result[i][j] = array[i][j];
				}else{
					result[i][j] = sum;
				}
			}
		}
		for(int j = 0;j < result[0].length;j++){
			int sum = 0;
			for(int i = 0; i < result.length;i++){
				if(i < result.length-1){
					sum+= result[i][j];
				}else{
					result[i][j] = sum;
				}
			}
		}
		return result;
	}

}

Compiler output:
Main.java:6: error: class MatrixLikeComputation is public, should be declared in a file named MatrixLikeComputation.java
public class MatrixLikeComputation {
       ^
1 error
Language: Java

import java.util.*;

public class a {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int all_sum =0;
		while( true )
		{
		
			String n = in.nextLine();
			int length = Integer.parseInt(n);
			
			if(length == 0){
				break;
			}
			
			int col_sum[] = new int[length];
			
			for(int i=0; i<length; i++)
			{
				String buf = in.nextLine();
				String val[] = buf.split(" ");
				int array[][] = new int[length][val.length];
				int line_sum = 0;
				
				for(int j=0; j<val.length; j++){
					array[i][j] = Integer.parseInt(val[j]);
					System.out.printf("%5d",array[i][j]);
					line_sum += array[i][j];
					col_sum[j] += array[i][j];
				}
				System.out.printf("%5d\n",line_sum);
				all_sum += line_sum;
			}
			for(int k=0; k<col_sum.length; k++)
			{
				System.out.printf("%5d", col_sum[k]);
			}
			System.out.printf("%5d\n",all_sum);
			all_sum = 0;
		}
	}
}

Compiler output:
Main.java:3: error: class a is public, should be declared in a file named a.java
public class a {
       ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][] array = new int[n + 1][n + 1];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                array[i][j] = scan.nextInt();
            }
        }
        int sum = 0;
        for(int i = 0; i < n; i++){
            int xsum = 0;
            int ysum = 0;
            for(int j = 0; j < n; j++){
                xsum += array[j][i];
                jsum += array[i][j];
            }
            array[n][i] = xsum;
            array[i][n] = ysum;
            sum += xsum;
        }
        array[n][n] = sum;

        for(int i = 0; i <= n; i++){
            for(int j = 0; j <= n; j++){
                System.out.printf("%5d",array[i][j]);
            }
            System.out.println("");
        }
    }
}

Compiler output:
Main.java:19: error: cannot find symbol
                jsum += array[i][j];
                ^
  symbol:   variable jsum
  location: class Main
1 error