submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s773238625
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; int j; bool checking = true; for( j = 0; j<=n; j++) { checking = true; char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; checking = check; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } checking = true; } if(j)cout << endl; if(checking == false) { cout << endl; checking = true; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 20 | gets(s); | ^~~~ | getw
s802766795
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #include <stdio.h> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; int j; bool checking = true; for( j = 0; j<=n; j++) { checking = true; char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; checking = check; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } checking = true; } if(j)cout << endl; if(checking == false) { cout << endl; checking = true; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 21 | gets(s); | ^~~~ | getw
s841253359
p00101
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<cmath> #include<utility> #include<set> #include<complex> #include<map> #define vi vector<int> #define vvi vector<vector<int> > #define ll long long int #define vl vector<ll> #define vvl vector<vector<ll>> #define vb vector<bool> #define vc vector<char> #define vs vector<string> #define ld long double #define INF 1e9 #define EPS 0.0000000001 #define rep(i,n) for(int i=0;i<n;i++) #define loop(i,s,n) for(int i=s;i<n;i++) #define CC puts("-------ok--------"); #define all(in) in.begin(), in.end() using namespace std; #define MAX_SIZE 10000 typedef pair<int, int> pii; #define MAX 99999999 int main(){ int n; cin >> n; // cout << n << endl; int j; bool checking = true; for( j = 0; j<=n; j++) { checking = true; char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; checking = check; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } checking = true; } if(j)cout << endl; if(checking == false) { cout << endl; checking = true; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:44:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 44 | gets(s); | ^~~~ | getw
s078688754
p00101
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<cmath> #include<utility> #include<set> #include<complex> #include<map> #define vi vector<int> #define vvi vector<vector<int> > #define ll long long int #define vl vector<ll> #define vvl vector<vector<ll>> #define vb vector<bool> #define vc vector<char> #define vs vector<string> #define ld long double #define INF 1e9 #define EPS 0.0000000001 #define rep(i,n) for(int i=0;i<n;i++) #define loop(i,s,n) for(int i=s;i<n;i++) #define CC puts("-------ok--------"); #define all(in) in.begin(), in.end() using namespace std; #define MAX_SIZE 10000 typedef pair<int, int> pii; #define MAX 99999999 int main(){ int n; cin >> n; // cout << n << endl; int j; bool checking = true; for( j = 0; j<=n; j++) { checking = true; char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; checking = check; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } checking = true; } if(j)cout << endl; if(checking == false) { cout << endl; checking = true; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:44:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 44 | gets(s); | ^~~~ | getw
s259906701
p00101
C++
#include <stdio.h> #include <string.h> int main() { int n; char str[1000]; scanf("%d", &n); for (int i = 0; i < n+1; i++) { gets(str); if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a'; printf("%s\n", str); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(str); | ^~~~ | getw
s235812577
p00101
C++
#include <stdio.h> #include <string.h> int main() { int n; char str[1001]; scanf("%d\n", &n); for (int i = 0; i < n; i++) { gets(str); while (1) { if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a'; else break; } puts(str); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(str); | ^~~~ | getw
s975571261
p00101
C++
#include <stdio.h> #include <string.h> int main(void) { int i,j; int n = 0; char strsent[50][1000] = { 0 }; char work[1000] = { 0 }; scanf("%d", &n); getchar(); for(i = 0; i < n; i++) { // ???????????\??? gets(strsent[i]); } for(i = 0; i < n; i++) { for(j = 0; strsent[i][j] != '\0'; j++){ // null?????§?????? if( strsent[i][j+1] == '\0' || strsent[i][j+2] == '\0' || strsent[i][j+3] == '\0' || strsent[i][j+4] == '\0' || strsent[i][j+5] == '\0' || strsent[i][j+6] == '\0' ) { // ???????????????????????°?????????????????§?????? break; } if( strsent[i][j] == 'H' && strsent[i][j+1] == 'o' && strsent[i][j+2] == 's' && strsent[i][j+3] == 'h' && strsent[i][j+4] == 'i' && strsent[i][j+5] == 'n' && strsent[i][j+6] == 'o' ) { // Hoshino?????´??????Hoshina????¨???£ strsent[i][j+6] = 'a'; } } printf("%s\n", strsent[i]); } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(strsent[i]); | ^~~~ | getw
s750708193
p00101
C++
#include <stdio.h> #include <string.h> int main(void) { int i,j; int n = 0; char strsent[50][1000] = { 0 }; char work[1000] = { 0 }; scanf("%d", &n); getchar(); for(i = 0; i < n; i++) { // ???????????\??? gets(strsent[i]); } for(i = 0; i < n; i++) { for(j = 0; strsent[i][j] != '\0'; j++){ // null?????§?????? if( strsent[i][j+1] == '\0' || strsent[i][j+2] == '\0' || strsent[i][j+3] == '\0' || strsent[i][j+4] == '\0' || strsent[i][j+5] == '\0' || strsent[i][j+6] == '\0' ) { // ???????????????????????°?????????????????§?????? break; } if( strsent[i][j] == 'H' && strsent[i][j+1] == 'o' && strsent[i][j+2] == 's' && strsent[i][j+3] == 'h' && strsent[i][j+4] == 'i' && strsent[i][j+5] == 'n' && strsent[i][j+6] == 'o' ) { // Hoshino?????´??????Hoshina????¨???£ strsent[i][j+6] = 'a'; } } printf("%s\n", strsent[i]); } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(strsent[i]); | ^~~~ | getw
s512276138
p00101
C++
#include <iostream> int main(){ int data_set_num; std::string str; std::string from = "Hoshino"; std::string to = "Hoshina"; std::cin >> data_set_num; while(data_set_num--){ std::getline(cin,str); string::size_type pos = str.find(from); while(pos != string::npos){ str.replace(pos, from.size(), to); pos = str.find(from, pos + to.size()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:22: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | std::getline(cin,str); | ^~~ | 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:13:9: error: 'string' has not been declared 13 | string::size_type pos = str.find(from); | ^~~~~~ a.cc:14:15: error: 'pos' was not declared in this scope 14 | while(pos != string::npos){ | ^~~ a.cc:14:22: error: 'string' has not been declared 14 | while(pos != string::npos){ | ^~~~~~
s358236450
p00101
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; }
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 | ^~~
s503077140
p00101
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; }
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){ | ^~~
s567955130
p00101
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; }
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){ | ^~~
s814089534
p00101
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; }
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
s456489695
p00101
C++
import string n=int(input()) for i in range(n): print(input().replace("Hoshino", "Hoshina"))
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'
s268086219
p00101
C++
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 #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){ if(it == (str.end() - 1)){ line = line + *it; }else{ line = line + *it + " "; } } //output line data std::cout << line << std::endl; } return 0; }
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 2 | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:43: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 179 | _GLIBCXX_NODI
s516849024
p00101
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; }
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()){ | ^~~~
s724929413
p00101
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'
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()) | ^
s224173160
p00101
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); } } } }
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) | ^~~~~~~
s828144151
p00101
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; }
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
s794953904
p00101
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; } }
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) | ^~~~
s418940474
p00101
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; } }
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) | ^~~~
s433040277
p00101
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; } }
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) | ^~~~
s455735885
p00101
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; }
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
s779661767
p00101
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; }
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
s723750851
p00101
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; }
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"; | ^~~~
s694428000
p00101
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; }
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"; | ^~~~
s136384843
p00101
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; }
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"; | ^~~~~~~~~
s420725860
p00101
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; }
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")
s265807997
p00101
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]==fa){ if(english[j+7]==" "||english[j+7]=="\0") english[j]=tr; } } std::cout << english; } return 0; }
a.cc: In function 'int main()': a.cc:14:38: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 14 | if(english[j]==fa){ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 | operator==(const __new_allocator&, const __new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/14/bits/new_allocator.h:215:9: note: template argument deduction/substitution failed: a.cc:14:40: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__new_allocator<_Tp>' 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::fpos<_StateT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::allocator<_CharT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::pair<_T1, _T2>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:14:40: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const _CharT*' and 'char' 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'templa
s148345154
p00101
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]==fa){ english[j]=tr; } } std::cout << english; } return 0; }
a.cc: In function 'int main()': a.cc:14:38: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 14 | if(english[j]==fa){ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 | operator==(const __new_allocator&, const __new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/14/bits/new_allocator.h:215:9: note: template argument deduction/substitution failed: a.cc:14:40: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__new_allocator<_Tp>' 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::fpos<_StateT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::allocator<_CharT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::pair<_T1, _T2>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:14:40: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 14 | if(english[j]==fa){ | ^~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:14:40: note: mismatched types 'const _CharT*' and 'char' 14 | if(english[j]==fa){ | ^~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'templa
s331403185
p00101
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; }
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
s787753688
p00101
C++
include <iostream> #include <string> using namespace std; int main(void){ int line_length; cin>>line_length;cin.ignore(2); string input; for(int i=0;i<line_length;++i){ getline(cin,input); std::string::size_type pos; while(( pos = input.find("Hoshino")) != std::string::npos){ input.replace(pos, 7, "Hoshina"); } cout << input<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type 198 | _GLIBCXX14_CONSTEXPR std::size_t |
s643393610
p00101
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; }
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
s485968865
p00101
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; }
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
s348592728
p00101
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; } } }
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); | ^~~~~~
s070292222
p00101
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; } } }
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
s892322017
p00101
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)); } } }
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)); | ^~~~~~
s400890741
p00101
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())); } }
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
s757943170
p00101
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; } }
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;
s162104554
p00101
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;
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 | { | ^
s981179344
p00101
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;}
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
s217779709
p00101
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; } }
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>
s320583122
p00101
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; }
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>
s544768027
p00101
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; }
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>
s873412390
p00101
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; }
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>
s807820956
p00101
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; }
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>
s149476721
p00101
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; }
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>'
s958453160
p00101
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; }
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>'
s862363628
p00101
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; }
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; | ^~~~
s916283881
p00101
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")); } } }
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")); | ^
s330342615
p00101
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; }
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); | ^~~~~~
s824276228
p00101
C++
#include <iostream> using namespace std; int main() { int n; cin>>n; cin.ignore(); string line; string s = "Hoshina"; while((getline, line)) { string("Hoshino"!=string::npos) line.replace()s; } cout<<line<<endl; return 0; }
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>} a.cc:12:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | string("Hoshino"!=string::npos) | ~~~~~~~~~^~~~~~~~~~~~~~ a.cc:12:34: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(bool)' 12 | string("Hoshino"!=string::npos) | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = bool; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:12:20: note: cannot convert '(((const char*)"Hoshino") != ((const char*)((long unsigned int)std::__cxx11::basic_string<char>::npos)))' (type 'bool') to type 'const char*' 12 | string("Hoshino"!=string::npos) | ~~~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'bool' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'bool' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40:
s219289705
p00101
C++
#include <iostream> using namespace std; int main() { int n; cin>>n; cin.ignore(); string line; string s = "Hoshina"; while((getline, line)) { string("Hoshino"!=string::npos) line=s; } cout<<line<<endl; return 0; }
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>} a.cc:12:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | string("Hoshino"!=string::npos) | ~~~~~~~~~^~~~~~~~~~~~~~ a.cc:12:34: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(bool)' 12 | string("Hoshino"!=string::npos) | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = bool; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:12:20: note: cannot convert '(((const char*)"Hoshino") != ((const char*)((long unsigned int)std::__cxx11::basic_string<char>::npos)))' (type 'bool') to type 'const char*' 12 | string("Hoshino"!=string::npos) | ~~~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'bool' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'bool' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40:
s993051081
p00101
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; }
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>}
s847330205
p00101
C++
feawfae
a.cc:1:1: error: 'feawfae' does not name a type 1 | feawfae | ^~~~~~~
s942518412
p00101
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; }
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include? 2 | #inlcude<string> | ^~~~~~~ | include
s370718103
p00101
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; } }
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; | ^~~~
s348063713
p00101
C++
fa
a.cc:1:1: error: 'fa' does not name a type 1 | fa | ^~
s304701142
p00101
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; } }
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>
s870192610
p00101
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; }
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) | ^~~~~~
s073383645
p00101
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; getline(std::cin, num_of_data); for(u_int i = 0; i < num_of_data; ++i){ getline(std::cin, text); u_int index = 0; while((index = text.find(str_false, index)) != std::string::npos){ text.replace(index, str_false.size(), str_true); index += str_false.size() + 1; } std::cout << text << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:12: error: no matching function for call to 'getline(std::istream&, u_int&)' 11 | getline(std::cin, num_of_data); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 907 | getline(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4117 | getline(basic_istream<_CharT, _Traits>& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4117:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'u_int' {aka 'unsigned int'} 11 | getline(std::cin, num_of_data); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 4125 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4132 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: template argument deduction/substitution failed: a.cc:11:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'u_int' {aka 'unsigned int'} 11 | getline(std::cin, num_of_data); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154: /usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ^~~~~~~ /usr/include/stdio.h:697:18: note: candidate expects 3 arguments, 2 provided
s033663878
p00102
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(); } } } }
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
s079054745
p00102
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; } }
Main.java:7: error: class MatrixLikeComputation is public, should be declared in a file named MatrixLikeComputation.java public class MatrixLikeComputation { ^ 1 error
s142422256
p00102
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; } }
Main.java:6: error: class MatrixLikeComputation is public, should be declared in a file named MatrixLikeComputation.java public class MatrixLikeComputation { ^ 1 error
s567133304
p00102
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; } } }
Main.java:3: error: class a is public, should be declared in a file named a.java public class a { ^ 1 error
s783206661
p00102
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(""); } } }
Main.java:19: error: cannot find symbol jsum += array[i][j]; ^ symbol: variable jsum location: class Main 1 error
s791752040
p00102
Java
public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { while (sc.hasNext()) { int n = Integer.parseInt(sc.nextLine()); calcMat(n); } } private static void calcMat(int n) { int[][] mt = new int[n + 1][n + 1]; for (int i = 0; i < n; i++) { String[] dt = sc.nextLine().split(" "); for (int j = 0; j < n; j++) { mt[i][j] = Integer.parseInt(dt[j]); mt[i][n] += mt[i][j]; mt[n][j] += mt[i][j]; } } for (int i = 0; i < n; i++) { mt[n][n] += mt[i][n]; } for (int i = 0; i < n + 1; i++) { for (int j = 0; j < n + 1; j++) { String sp = (j < n)? "" : "\n"; System.out.printf("%5d%s",mt[i][j] ,sp); } } } }
Main.java:3: error: cannot find symbol static Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol static Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s050974115
p00102
Java
import java.util.*; public class Main { Scanner sc = new Scanner)System.in; void run() { while (true) { int n = sc.nextInt(); if (n == 0) break; int[][] mat = new int[n+1][n+1]; for (int i=0;i<n;i++) for (int j=0;j<n;j++) { mat[i][j] = sc.nextInt(); mat[i][n] = mat[i][j]; mat[n][j] = mat[i][j]; } for( int i=0;i<n+1;i++) {for(int j=0;j<n+1;j++) { System.out.printf("%5d",mat[i][j]); } System.out.println(); } } } public static void main(String[] args) { new Main().run(); } }
Main.java:4: error: '(' or '[' expected Scanner sc = new Scanner)System.in; ^ Main.java:4: error: <identifier> expected Scanner sc = new Scanner)System.in; ^ 2 errors
s287261746
p00102
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import sun.security.krb5.KdcComm; import sun.tools.jar.resources.jar; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { int value; BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); List<String> listStrings = new ArrayList<String>(); List<Integer> listMaxIntegers = new ArrayList<Integer>(); while((value = Integer.parseInt(reader.readLine())) != 0){ listMaxIntegers.add(value); for(int i = 0; i < value; i++) listStrings.add(reader.readLine()); } value = 0; for(int max : listMaxIntegers){ int sum = 0; int[][] list = new int[max][max]; for(int i = value; i - value < max;i++){ String[] split = listStrings.get(i).split(" "); int sumOf = 0; for(int j = 0; j < max; j++){ sumOf += Integer.parseInt(split[j]); list[i - value][j] = Integer.parseInt(split[j]); System.out.printf("%5d", Integer.parseInt(split[j])); } System.out.printf("%5d\n", sumOf); } int[] listSum = new int[max]; for(int j = 0; j < max; j++){ int sumOf = 0; for(int k = 0; k < max; k++){ sumOf += list[k][j]; } System.out.printf("%5d", sumOf); listSum[j] = sumOf; sum+= sumOf; } System.out.printf("%5d\n", sum); value += max; } } }
Main.java:7: error: package sun.security.krb5 is not visible import sun.security.krb5.KdcComm; ^ (package sun.security.krb5 is declared in module java.security.jgss, which does not export it to the unnamed module) Main.java:8: error: package sun.tools.jar.resources is not visible import sun.tools.jar.resources.jar; ^ (package sun.tools.jar.resources is declared in module jdk.jartool, which does not export it) 2 errors
s322125469
p00102
C
#include<stdio.h> int main(void){ int a[11][11]; int b[11][11]; int i,j,k,l; int n; while(1){ a[11][11]={0}; b[11][11]={0}; scanf("%d",&n); if(n==0) break; for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); for(i=0;i<n;i++) for(j=0;j<n;j++) a[i][n]+=a[i][j]; for(j=0;j<n;j++) for(i=0;i<n;i++) a[n][j]+=a[i][j]; for(i=0;i<n;i++) a[n][n]+=a[i][n]; for(i=0;i<n+1;i++){ for(j=0;j<n+1;j++) printf("%5d",a[i][j]); printf("\n"); } } return 0; }
main.c: In function 'main': main.c:9:15: error: expected expression before '{' token 9 | a[11][11]={0}; | ^ main.c:10:15: error: expected expression before '{' token 10 | b[11][11]={0}; | ^
s708644996
p00102
C
#include<stdio.h> int main(){ int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0,j<a;j++){ for(i=0,i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i] y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8] } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]) }else{ break; } } return 0; }
main.c: In function 'main': main.c:4:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:46: error: expected expression before ',' token 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:48: error: 'a' undeclared (first use in this function) 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:48: note: each undeclared identifier is reported only once for each function it appears in main.c:4:51: error: 'i' undeclared (first use in this function) 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:54: error: 'j' undeclared (first use in this function) 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:8:40: error: expected ';' before ')' token 8 | for(j=0,j<a;j++){ | ^ | ; main.c:9:40: error: expected ';' before ')' token 9 | for(i=0,i<a;i++){ | ^ | ; main.c:14:111: error: expected ';' before 'y' 14 | x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i] | ^ | ; 15 | y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8] | ~ main.c:18:31: error: 'o' undeclared (first use in this function) 18 | for(j=o;j<a;j++){ | ^ main.c:21:38: error: 'y' undeclared (first use in this function) 21 | printf("%5d",y[i]); | ^ main.c:26:128: error: expected ';' before '}' token 26 | printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]) | ^ | ; 27 | }else{ | ~
s882092045
p00102
C
#include<stdio.h> int main(){ int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0,j<a;j++){ for(i=0,i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else{ break; } } return 0; }
main.c: In function 'main': main.c:4:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:46: error: expected expression before ',' token 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:48: error: 'a' undeclared (first use in this function) 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:48: note: each undeclared identifier is reported only once for each function it appears in main.c:4:51: error: 'i' undeclared (first use in this function) 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:4:54: error: 'j' undeclared (first use in this function) 4 | int n[10][10] = {}, x[9] ={}, y[9] {}, a, i, j; | ^ main.c:8:40: error: expected ';' before ')' token 8 | for(j=0,j<a;j++){ | ^ | ; main.c:9:48: error: expected ';' before ')' token 9 | for(i=0,i<a;i++){ | ^ | ; main.c:15:33: error: 'y' undeclared (first use in this function) 15 | y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; | ^ main.c:18:39: error: 'o' undeclared (first use in this function) 18 | for(j=o;j<a;j++){ | ^
s828931064
p00102
C
#include<stdio.h> int main(){ int n[10][10] = {}, x[9] = {}, y[9] = {}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0,j<a;j++){ for(i=0,i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else{ break; } } return 0; }
main.c: In function 'main': main.c:8:40: error: expected ';' before ')' token 8 | for(j=0,j<a;j++){ | ^ | ; main.c:9:48: error: expected ';' before ')' token 9 | for(i=0,i<a;i++){ | ^ | ; main.c:18:39: error: 'o' undeclared (first use in this function) 18 | for(j=o;j<a;j++){ | ^ main.c:18:39: note: each undeclared identifier is reported only once for each function it appears in
s258456242
p00102
C
#include<stdio.h> int main(){ int n[10][10] = {}, x[9] = {}, y[9] = {}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0,j<a;j++){ for(i=0,i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else if(a=0){ break; } } return 0; }
main.c: In function 'main': main.c:8:40: error: expected ';' before ')' token 8 | for(j=0,j<a;j++){ | ^ | ; main.c:9:48: error: expected ';' before ')' token 9 | for(i=0,i<a;i++){ | ^ | ; main.c:18:39: error: 'o' undeclared (first use in this function) 18 | for(j=o;j<a;j++){ | ^ main.c:18:39: note: each undeclared identifier is reported only once for each function it appears in
s456336264
p00102
C
#include<stdio.h> int main(){ int n[9][9] = {0}, x[9] = {0}, y[9] = {0}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0,j<a;j++){ for(i=0,i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else if(a=0){ break; } } return 0; }
main.c: In function 'main': main.c:8:40: error: expected ';' before ')' token 8 | for(j=0,j<a;j++){ | ^ | ; main.c:9:48: error: expected ';' before ')' token 9 | for(i=0,i<a;i++){ | ^ | ; main.c:18:39: error: 'o' undeclared (first use in this function) 18 | for(j=o;j<a;j++){ | ^ main.c:18:39: note: each undeclared identifier is reported only once for each function it appears in
s467113701
p00102
C
#include<stdio.h> int main(){ int n[9][9] = {0}, x[9] = {0}, y[9] = {0}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0;j<a;j++){ for(i=0;i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else if(a=0){ break; } } return 0; }
main.c: In function 'main': main.c:17:39: error: 'o' undeclared (first use in this function) 17 | for(j=o;j<a;j++){ | ^ main.c:17:39: note: each undeclared identifier is reported only once for each function it appears in
s079339432
p00102
C
#include<stdio.h> #include<stdafx.h> int main(){ int n[9][9] = {0}, x[9] = {0}, y[9] = {0}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0;j<a;j++){ for(i=0;i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else if(a=0){ break; } } return 0; }
main.c:2:9: fatal error: stdafx.h: No such file or directory 2 | #include<stdafx.h> | ^~~~~~~~~~ compilation terminated.
s148881683
p00102
C
#include<stdio.h> int main(){ int i,j,ans[10]={0},n,tmp,sum; while(scanf("%d",&n)!=EOF){ for(i=0;i<n;i++){ for(j=0;j<n;j++){ scnaf("%d",&tmp); if(i==0)ans[j]=tmp; else ans[j]+=tmp; if(j==0)sum=tmp; else sum+=tmp; printf("%5d",tmp); } printf("%5d\n",sum); } for(i=0,sum=0;i<n;i++){ printf("%5d",ans[i]); sum+=ans[i]; } printf("%5d\n",sum); } return 0; }
main.c: In function 'main': main.c:7:33: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scnaf("%d",&tmp); | ^~~~~ | scanf
s335740068
p00102
C
#include<stdio.h> int main(void){ int i,j,ans[10]={0},n,tmp,sum; while(scanf("%d",&n),n!=EOF){ for(i=0;i<n;i++){ for(j=0;j<n;j++){ scnaf("%d",&tmp); if(i==0)ans[j]=tmp; else ans[j]+=tmp; if(j==0)sum=tmp; else sum+=tmp; printf("%5d",tmp); } printf("%5d\n",sum); } for(i=0,sum=0;i<n;i++){ printf("%5d",ans[i]); sum+=ans[i]; } printf("%5d\n",sum); } return 0; }
main.c: In function 'main': main.c:7:33: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scnaf("%d",&tmp); | ^~~~~ | scanf
s679747855
p00102
C
#include<stdio.h> int main(void){ int i,j,ans[10]={0},n,tmp,sum; while(scanf("%d",&n)!=EOF){ for(i=0;i<n;i++){ for(j=0;j<n;j++){ scnaf("%d",&tmp); if(i==0)ans[j]=tmp; else ans[j]+=tmp; if(j==0)sum=tmp; else sum+=tmp; printf("%5d",tmp); } printf("%5d\n",sum); } for(i=0,sum=0;i<n;i++){ printf("%5d",ans[i]); sum+=ans[i]; } printf("%5d\n",sum); } return 0; }
main.c: In function 'main': main.c:7:33: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scnaf("%d",&tmp); | ^~~~~ | scanf
s296111078
p00102
C
#inclued <stdio.h> #include <assert.h> #include <limits.h> int main() { int i, j, k = 0; int n[INT_MAX], data[INT_MAX][INT_MAX][INT_MAX]; do { scanf("%d", &n[k]); assert(n[k] <= 10); for(i = 0; i < n[k]; i ++) { for(j = 0; j < n[k]; j ++) { scanf("%d ", &data[i][j][k]); assert(data[i][j][k] <= 100); data[n[k]][j] += data[i][j][k]; data[i][n[k]] += data[i][j][k]; } } data[n[k]][n[k]][k] = data[i][n[k]][k] + datan[n[k]][j][k]; k ++; } while(n[k] != 0); for(int l = 0; l < k; l ++) { for(i = 0; i <= n[l]; i ++) { for(j = 0; j <= n[l]; j ++) { printf("%5d", &data[i][j][l]); } printf("\n"); if(i == n[l]) printf("%5d", &data[i][j][l]); } } return 0; }
main.c:1:2: error: invalid preprocessing directive #inclued; did you mean #include? 1 | #inclued <stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:7:25: error: size '18446744056529682436' of array 'data' exceeds maximum object size '9223372036854775807' 7 | int n[INT_MAX], data[INT_MAX][INT_MAX][INT_MAX]; | ^~~~ main.c:10:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%d", &n[k]); | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 3 | #include <limits.h> +++ |+#include <stdio.h> 4 | main.c:10:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | scanf("%d", &n[k]); | ^~~~~ main.c:10:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:22:58: error: 'datan' undeclared (first use in this function); did you mean 'data'? 22 | data[n[k]][n[k]][k] = data[i][n[k]][k] + datan[n[k]][j][k]; | ^~~~~ | data main.c:22:58: note: each undeclared identifier is reported only once for each function it appears in main.c:30:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 30 | printf("%5d", &data[i][j][l]); | ^~~~~~ main.c:30:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:30:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:30:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:32:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 32 | printf("\n"); | ^~~~~~ main.c:32:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s281294152
p00102
C
#inclued <stdio.h> #include <assert.h> #include <limits.h> int main() { int i, j, k = 0; int n[INT_MAX], data[INT_MAX][INT_MAX][INT_MAX]; do { scanf("%d", &n[k]); assert(n[k] <= 10); for(i = 0; i < n[k]; i ++) { for(j = 0; j < n[k]; j ++) { scanf("%d ", &data[i][j][k]); assert(data[i][j][k] <= 100); data[n[k]][j] += data[i][j][k]; data[i][n[k]] += data[i][j][k]; } } data[n[k]][n[k]][k] = data[i][n[k]][k] + datan[n[k]][j][k]; k ++; } while(n[k] != 0); for(int l = 0; l < k; l ++) { for(i = 0; i <= n[l]; i ++) { for(j = 0; j <= n[l]; j ++) { printf("%5d", &data[i][j][l]); } printf("\n"); if(i == n[l]) printf("%5d", &data[i][j][l]); } } return 0; }
main.c:1:2: error: invalid preprocessing directive #inclued; did you mean #include? 1 | #inclued <stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:7:25: error: size '18446744056529682436' of array 'data' exceeds maximum object size '9223372036854775807' 7 | int n[INT_MAX], data[INT_MAX][INT_MAX][INT_MAX]; | ^~~~ main.c:10:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%d", &n[k]); | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 3 | #include <limits.h> +++ |+#include <stdio.h> 4 | main.c:10:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | scanf("%d", &n[k]); | ^~~~~ main.c:10:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:22:58: error: 'datan' undeclared (first use in this function); did you mean 'data'? 22 | data[n[k]][n[k]][k] = data[i][n[k]][k] + datan[n[k]][j][k]; | ^~~~~ | data main.c:22:58: note: each undeclared identifier is reported only once for each function it appears in main.c:30:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 30 | printf("%5d", &data[i][j][l]); | ^~~~~~ main.c:30:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:30:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:30:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:32:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 32 | printf("\n"); | ^~~~~~ main.c:32:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s501877513
p00102
C
#inclued <stdio.h> #include <assert.h> #include <limits.h> int main() { int i, j, k = 0; int n[INT_MAX], data[INT_MAX][INT_MAX][INT_MAX]; do { scanf("%d", &n[k]); assert(n[k] <= 10); for(i = 0; i < n[k]; i ++) { for(j = 0; j < n[k]; j ++) { scanf("%d ", &data[i][j][k]); assert(data[i][j][k] <= 100); data[n[k]][j] += data[i][j][k]; data[i][n[k]] += data[i][j][k]; } } data[n[k]][n[k]][k] = data[i][n[k]][k] + datan[n[k]][j][k]; k ++; } while(n[k] != 0); for(int l = 0; l < k; l ++) { for(i = 0; i <= n[l]; i ++) { for(j = 0; j <= n[l]; j ++) { printf("%5d", &data[i][j][l]); } printf("\n"); if(i == n[l]) printf("%5d", &data[i][j][l]); } } return 0; }
main.c:1:2: error: invalid preprocessing directive #inclued; did you mean #include? 1 | #inclued <stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:7:25: error: size '18446744056529682436' of array 'data' exceeds maximum object size '9223372036854775807' 7 | int n[INT_MAX], data[INT_MAX][INT_MAX][INT_MAX]; | ^~~~ main.c:10:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%d", &n[k]); | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 3 | #include <limits.h> +++ |+#include <stdio.h> 4 | main.c:10:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | scanf("%d", &n[k]); | ^~~~~ main.c:10:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:22:58: error: 'datan' undeclared (first use in this function); did you mean 'data'? 22 | data[n[k]][n[k]][k] = data[i][n[k]][k] + datan[n[k]][j][k]; | ^~~~~ | data main.c:22:58: note: each undeclared identifier is reported only once for each function it appears in main.c:30:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 30 | printf("%5d", &data[i][j][l]); | ^~~~~~ main.c:30:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:30:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:30:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:32:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 32 | printf("\n"); | ^~~~~~ main.c:32:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s592229374
p00102
C
#include <cstdio> int main(){ int i,j,n,a[10][10],b[10],c[10],sum; while(1){ scanf("%d",&n); if(n == 0) break; sum = 0; for(i=0;i<n;i++){ b[i] = 0; for(j=0;j<n;j++){ scanf("%d",&a[i][j]); b[i] += a[i][j]; sum += a[i][j]; } } for(i=0;i<n;i++){ c[i] = 0; for(j=0;j<n;j++){ c[i] += a[j][i]; } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ printf("%5d ",a[i][j]); } printf("%5d\n",b[i]); } for(i=0;i<n;i++){ printf("%5d ",c[i]); } printf("%5d\n",sum); } return 0; }
main.c:2:10: fatal error: cstdio: No such file or directory 2 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s750466636
p00102
C
#include<stdio.h> int main(void){ int i,j,n,table[11][11],w; while(1){ scanf("%d",&n); if(n==0)break; w=0; for(i=0;i<11;i++) table[n][i]=0; for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&table[i][j]); w+=table[i][j]; if(j==n-1){ table[i][j+1]=w; w=0; } table[n][j]+=table[i][j]; } } for(i=0;i<n;i++){ table[n][n]+=table[n][i]; } for(i=0;i<=n;i++){ for(j=0;j<=n;j++){ printf("%5d",table[i][j]); printf((j==n)?"\n":); } } } return 0; }
main.c: In function 'main': main.c:32:28: error: expected expression before ')' token 32 | printf((j==n)?"\n":); | ^
s443511557
p00102
C
#include<iostream> #include<iomanip> using namespace std; int matrix[11][11]; int main() { int n,sum; for(;;) { cin>>n; if(n==0)break; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { cin>>matrix[i][j]; } } for(int i=0;i<n;i++) { sum=0; for(int j=0;j<n;j++) { sum+=matrix[i][j]; } matrix[i][n]=sum; } for(int j=0;j<n;j++) { sum=0; for(int i=0;i<n;i++) { sum+=matrix[i][j]; } matrix[n][j]=sum; } sum=0; for(int i=0;i<n;i++) { sum+=matrix[i][n]; } matrix[n][n]=sum; for(int i=0;i<=n;i++) { for(int j=0;j<=n;j++) { if(j>0)cout<<' '; cout<<setfill(' ')<<setw(5)<<right<<matrix[i][j]; } cout<<endl; } } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s188111643
p00102
C
#include<stdio.h> #include<string> #include<stdlib.h> #include<math.h> #include<iostream> #include<vector> #include<algorithm> #include<numeric> #include<string.h> using namespace std; typedef pair<int,int> pii; #define rep(i,j) for(int i=0;i<(j);i++) #define reps(i,j,k) for(int i=j;i<=k;i++) int main(){ int n,t; int d[20][20]; for(;;){ scanf("%d",&n); if(n==0)break; rep(i,n){ t=0; rep(j,n){ scanf("%d",d[i]+j); t+=d[i][j]; } d[i][n]=t; } rep(i,n+1){ t=0; rep(j,n)t+=d[j][i]; d[n][i]=t; } rep(i,n+1){rep(j,n+1)printf("%5d",d[i][j]);puts("");} } return 0; }
main.c:2:9: fatal error: string: No such file or directory 2 | #include<string> | ^~~~~~~~ compilation terminated.
s810916415
p00102
C
#include<stdio.h> int main(void) { int a[10]={0},b[10]={0}; int i,k,x[10][10],n,sum=0; scanf("%d",&n); for(i=0;i<n;i++){ for(k=0:k<n;k++){ scanf("%d",&x[i][k]); a[k]+=x; b[i]+=x; } } for(i=0;i<n;i++){ for(k=0:k<n;k++){ printf("%5d",x[i][k]); } printf("%5d\n",b[i]); } for(i=0;i<n;i++){printf("%5d",a[i]);sum+=a[i];} printf("%5d\n",sum); return 0; }
main.c: In function 'main': main.c:10:12: error: expected ';' before ':' token 10 | for(k=0:k<n;k++){ | ^ | ; main.c:10:20: error: expected ';' before ')' token 10 | for(k=0:k<n;k++){ | ^ | ; main.c:12:11: error: assignment to 'int' from 'int (*)[10]' makes integer from pointer without a cast [-Wint-conversion] 12 | a[k]+=x; | ^~ main.c:13:11: error: assignment to 'int' from 'int (*)[10]' makes integer from pointer without a cast [-Wint-conversion] 13 | b[i]+=x; | ^~ main.c:18:12: error: expected ';' before ':' token 18 | for(k=0:k<n;k++){ | ^ | ; main.c:18:20: error: expected ';' before ')' token 18 | for(k=0:k<n;k++){ | ^ | ;
s076059517
p00102
C
#include<stdio.h> int main(void) { int a[10]={0},b[10]={0}; int i,k,x[10][10],n,sum=0; scanf("%d",&n); for(i=0;i<n;i++){ for(k=0;k<n;k++){ scanf("%d",&x[i][k]); a[k]+=x; b[i]+=x; } } for(i=0;i<n;i++){ for(k=0:k<n;k++){ printf("%5d",x[i][k]); } printf("%5d\n",b[i]); } for(i=0;i<n;i++){printf("%5d",a[i]);sum+=a[i];} printf("%5d\n",sum); return 0; }
main.c: In function 'main': main.c:12:11: error: assignment to 'int' from 'int (*)[10]' makes integer from pointer without a cast [-Wint-conversion] 12 | a[k]+=x; | ^~ main.c:13:11: error: assignment to 'int' from 'int (*)[10]' makes integer from pointer without a cast [-Wint-conversion] 13 | b[i]+=x; | ^~ main.c:18:12: error: expected ';' before ':' token 18 | for(k=0:k<n;k++){ | ^ | ; main.c:18:20: error: expected ';' before ')' token 18 | for(k=0:k<n;k++){ | ^ | ;
s647219599
p00102
C
include<stdio.h> main(){ int data,i,j; int a[101][101]; while(1){ scanf("%d",&data); if(data == 0) break; for(i=0;i<data;i++){ for(j=0;j<data;j++){ scanf("%d",&a[i][j]); a[i][data] += a[i][j]; a[data][j] += a[i][j]; a[data][data] += a[i][j]; } } for(i=0;i<data+1;i++){ for(j=0;j<data+1;j++){ printf("%5d",a[i][j]); if(j == data){ printf("\n"); } } } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s137910909
p00102
C++
#!/usr/bin/python # -*- coding: utf-8 -*- def main(): while(True): # 入力 N = int(raw_input()) if N == 0: break inp = [] for x in range(N): input_list = map(int, raw_input().split()) inp.append(input_list) printAns(inp) def printAns(num_list): add_list = [] for x in num_list: x.append(sum(x)) add_list.append(x) total_list = [sum(x) for x in zip(*add_list)] add_list.append(total_list) print5digit(add_list) def print5digit(num_list): for x in num_list: print "".join(map(lambda x_: str(x_).rjust(5), x)) if __name__=='__main__': main()
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/python | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding: utf-8 -*- | ^ a.cc:6:11: error: invalid preprocessing directive #\U00005165\U0000529b 6 | # 入力 | ^~~~ a.cc:32:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 32 | if __name__=='__main__': | ^~~~~~~~~~ a.cc:4:1: error: 'def' does not name a type 4 | def main(): | ^~~
s663866717
p00102
C++
#include<stdio.h> #include<iostream> #include<math.h> using namespace std; int main(){ int N,num[11][11]={},x; int a; while(1) {cin>>N; if(N==0)break; for(int i=0;i<N;i++){ for(int j=0;j<N;j++) {cin>>num[i][j];num[i][N]+=num[i][j];} } for(int i=0;i<N;i++) num[N][N]+=num[i][N]; for(int i=0;i<N;i++) for(int j=0;j<N;j++) num[N][i]+=num[j][i]; for(int i=0;i<=N;i++){ for(int j=0;j<=N;j++) { a =5-( (int)log10((double)(num[i][j]) )+ 1); for(int k=0;k<a;k++) {cout<<" ";} cout<<num[i][j];} cout<<endl;a=0 } for(int i=0;i<=N;i++){ for(int j=0;j<=N;j++){ num[i][j]=0; } } } return 0; }
a.cc: In function 'int main()': a.cc:29:15: error: expected ';' before '}' token 29 | cout<<endl;a=0 | ^ | ; ...... 32 | } | ~
s060096102
p00102
C++
#include<stdio.h> #include<iostream> #include<math.h> using namespace std; int main(){ double num[12][12]={}; int N ; int a=0; while(1) {cin>>N; if(N==0)break; for(int i=0;i<N;i++){ for(int j=0;j<N;j++) {cin>>num[i][j];num[i][N]+=num[i][j];} } for(int i=0;i<N;i++) num[N][N]+=num[i][N]; for(int i=0;i<N;i++) for(int j=0;j<N;j++) num[N][i]+=num[j][i]; for(int i=0;i<=N;i++){ for(int j=0;j<=N;j++) { printf("5%lf",num[i][;} cout<<endl; } for(int i=0;i<=N;i++){ for(int j=0;j<=N;j++){ num[i][j]=0; } } } return 0; }
a.cc: In function 'int main()': a.cc:26:22: error: expected primary-expression before ';' token 26 | printf("5%lf",num[i][;} | ^ a.cc:26:22: error: expected ']' before ';' token 26 | printf("5%lf",num[i][;} | ^ | ]
s227748796
p00102
C++
#include<stdio.h> #include<stdafx.h> int main(){ int n[9][9] = {0}, x[9] = {0}, y[9] = {0}, a, i, j; while(1){ scanf("%d",&a); if(a!=0){ for(j=0;j<a;j++){ for(i=0;i<a;i++){ scanf("%d",&n[j][i]); } } for(i=0;i<9;i++){ x[i] = n[0][i]+n[1][i]+n[2][i]+n[3][i]+n[4][i]+n[5][i]+n[6][i]+n[7][i]+n[8][i]; y[i] = n[i][0]+n[i][1]+n[i][2]+n[i][3]+n[i][4]+n[i][5]+n[i][6]+n[i][7]+n[i][8]; } for(i=0;i<a;i++){ for(j=o;j<a;j++){ printf("%5d",n[j][i]); } printf("%5d\n",y[i]); } for(i=0;i<a;i++){ printf("%5d",x[i]); } printf("%5d",x[0]+y[0]+x[1]+y[1]+x[2]+y[2]+x[3]+y[3]+x[4]+y[4]+x[5]+y[5]+x[6]+y[6]+x[7]+y[7]+x[8]+y[8]); }else if(a=0){ break; } } return 0; }
a.cc:2:9: fatal error: stdafx.h: No such file or directory 2 | #include<stdafx.h> | ^~~~~~~~~~ compilation terminated.
s354613663
p00102
C++
#include <iostream.h> #include <vector> using namespace std; int main(){ int data_size; cin >> data_size; while (data_size){ vector<vector<int>> data; vector<vector<int>> data_digit; data.resize((data_size + 1)*(data_size + 1)); data_digit.resize((data_size + 1) * (data_size + 1)); for (int i = 0; i < data_size; i++){ data[i].resize(data_size + 1); data_digit[i].resize(data_size + 1); for (int j = 0; j < data_size; j++){ cin >> data[i][j]; int tmp = data[i][j]; data_digit[i][j] = 0; while (tmp){ tmp /= 10; data_digit[i][j]++; } } } data[data_size].resize(data_size + 1); data_digit[data_size].resize(data_size + 1); for (int i = 0; i < data_size; i++){ int sum = 0; for (int j = 0; j < data_size; j++){ sum += data[i][j]; } data[i][data_size] = sum; int tmp = sum; data_digit[i][data_size] = 0; while (tmp){ tmp /= 10; data_digit[i][data_size]++; } } for (int i = 0; i < data_size + 1; i++){ int sum = 0; for (int j = 0; j < data_size; j++){ sum += data[j][i]; } data[data_size][i] = sum; int tmp = sum; data_digit[data_size][i] = 0; while (tmp){ tmp /= 10; data_digit[data_size][i]++; } } for (int i = 0; i < data_size + 1; i++){ for (int j = 0; j < data_size + 1; j++){ for (int k = data_digit[i][j]; k < 5; k++){ cout << " "; } cout << data[i][j]; } cout << "\n"; } cin >> data_size; } return 0; }
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s342529570
p00102
C++
import java.util.*; import java.lang.*; import java.io.*; public class Main{ public static void main (String[] args) throws java.lang.Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); while(!line.equals("0")){ int n = Integer.parseInt(line); int[] sum_arr = new int[n]; int[][] table = new int[n+1][n+1]; for(int i=0;i<n;i++){ line = br.readLine(); String[] lines = line.split(" "); int j=0; int sum = 0; for(String st:lines){ int tmp = Integer.parseInt(st); table[i][j] = tmp; sum += tmp; sum_arr[j] += tmp; ++j; } table[i][j] = sum; } int sum = 0; for(int i=0;i<n;i++){ table[n][i] = sum_arr[i]; sum += sum_arr[i]; } table[n][n] = sum; int length = Integer.toString(sum).length(); String fmt = "%" + length + "s"; for(int[] t:table){ int cnt = 0; for(int val:t){ if(cnt>0){ System.out.print(" "); cnt++; } System.out.print(String.format(fmt,Integer.toString(val))); } System.out.println(""); } line = br.readLine(); } } }
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:2:1: error: 'import' does not name a type 2 | import java.lang.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: expected unqualified-id before 'public' 5 | public class Main{ | ^~~~~~
s215975145
p00102
C++
//#define scanf_s scanf //#define sscanf_s sscanf //#define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 11 #define HO 6 int main(void) { int n; while (1) { scanf_s("%d", &n); if (n == 0) break; int date[MAX][MAX] = { 0 }; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { scanf_s("%d", &date[i][j]); date[i][n] += date[i][j]; date[n][j] += date[i][j]; date[n][n] += date[i][j]; } } for (int i = 0; i <= n; ++i) { for (int j = 0; j <= n; ++j) { printf("%5d", date[i][j]); } printf("\n"); } } }
a.cc: In function 'int main()': a.cc:15:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 15 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s608677486
p00102
C++
#include <string> #include <iostream> #include <vector> #include <sstream> #include <memory> #include <iomanip> int main(int argc, char* argv[]) { while (true) { std::string line; std::stringstream buffer; getline(std::cin, line); buffer << line; size_t length = 0; buffer >> length; if (length == 0) break; int *total = new int[length + 1]; size_t width = length + 1; memset(total, 0, sizeof(int) * width); for (size_t i = 0; i < length; ++i) { getline(std::cin, line); std::istringstream s(line); std::string element; int sum = 0; for (size_t n = 0; n < length; ++n) { getline(s, element, ' '); std::stringstream tmp; int val = 0; tmp << element; tmp >> val; sum += val; total[n] += val; std::cout << std::setw(5) << val; } std::cout << std::setw(5) << sum << std::endl; total[length] += sum; } for (size_t i = 0; i < width; ++i) { std::cout << std::setw(5) << total[i]; } std::cout << std::endl; delete[] total; } return 0; }
a.cc: In function 'int main(int, char**)': a.cc:20:9: error: 'memset' was not declared in this scope 20 | memset(total, 0, sizeof(int) * width); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <iomanip> +++ |+#include <cstring> 7 |
s008229549
p00102
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; int main(){ int n,c; while(cin>>n,n){ int a[n+1][n+1]; rep(i,n){c=0;rep(j,n){ cin>>a[i][j]; c+=a[i][j]; } a[i][n]=c; } rep(j,n){c=0;rep(i,n){ c+=a[i][j]; } a[n][j]=c; } rep(i,n+1){rep(i,n+1){cout<<a[i][j];}cout<<endl;} } }
a.cc: In function 'int main()': a.cc:19:36: error: 'j' was not declared in this scope 19 | rep(i,n+1){rep(i,n+1){cout<<a[i][j];}cout<<endl;} | ^
s741643435
p00102
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int sub; int sum; int all; while(s.hasNext()){ sub = s.nextInt(); all = 0; if(sub == 0) break; int[][] table = new int[sub][sub]; for(int i = 0; i < sub; i++){ sum = 0; for(int j = 0; j < sub; j++){ table[i][j] = s.nextInt(); sum += table[i][j]; System.out.printf("%5d",table[i][j]); if(j == sub - 1){ System.out.printf("%5d", sum); System.out.println(); } } } for(int j = 0; j < sub; j++){ sum = 0; for(int i = 0; i < sub; i++){ sum += table[i][j]; } all += sum; System.out.printf("%5d", sum); } System.out.printf("%5d", all); System.out.println(); } s.close(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~