submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s043828337
p00013
C++
#define _CRT_SECURE_NO_WARNINGS #include <vector> #include <iostream> using namespace std; int main() { int in; vector <int> a; while (cin >> in;) { if (in == 0) { cout << a.back(); a.pop_back(); /*if (a.size() == 0) break; else*/ cout << endl; } else a.push_back(in); } return 0; }
a.cc: In function 'int main()': a.cc:9:25: error: expected ')' before ';' token 9 | while (cin >> in;) { | ~ ^ | ) a.cc:9:26: error: expected primary-expression before ')' token 9 | while (cin >> in;) { | ^
s719794723
p00013
C++
#include <cstdio> #include <stack> using namespace std; int main(){ int n; stack<int> car; while(scanf("%d",&n)!) { if(n!=0) car.push(n); else{ printf("%d\n",car.top()); car.pop(); } } return 0; }
a.cc: In function 'int main()': a.cc:7:29: error: expected ')' before '!' token 7 | while(scanf("%d",&n)!) { | ~ ^ | ) a.cc:7:30: error: expected primary-expression before ')' token 7 | while(scanf("%d",&n)!) { | ^
s805242499
p00013
C++
#include <iostream> #include <stack> using namespace std; int main() { int n, count = 0, a[10], i; stack<int> s; while (cin >> n,n>=0,!cin.eof()) { if (n > 0) s.push(n); else if (n == 0) { a[count] = s.top(); s.pop(); count++} } for (i = 0; i < count; i++) { cout << a[i] << endl; } }
a.cc: In function 'int main()': a.cc:10:72: error: expected ';' before '}' token 10 | else if (n == 0) { a[count] = s.top(); s.pop(); count++} | ^ | ;
s677828416
p00013
C++
#include <stack> using namespace std; int main() { stack<int> s; int k; while (cin >> k){ if (0 == k){ k = s.top(); s.pop(); cout << k << "\n"; } else s.push(k); } return 0; }
a.cc: In function 'int main()': a.cc:7:16: error: 'cin' was not declared in this scope 7 | while (cin >> k){ | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <stack> +++ |+#include <iostream> 2 | using namespace std; a.cc:11:25: error: 'cout' was not declared in this scope 11 | cout << k << "\n"; | ^~~~ a.cc:11:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s113345232
p00013
C++
#include <iostream> #include <stack> int main(){ std::stack<int> train; int buf; while(std::cin >> buf){ if(buf == 0){ std::cout << train.top() << endl; train.pop(); }else{ train.push(buf); } } return 0; }
a.cc: In function 'int main()': a.cc:14:53: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 14 | std::cout << train.top() << 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) | ^~~~
s294461286
p00013
C++
#include <iostream> int main(){ std::stack<int> railroad; int incar; while(std::cin >> incar){ if(incar != 0){ railroad.push(incar); }else{ std::cout << railroad.top() << std::endl; railroad.pop(); } } return 0; }
a.cc: In function 'int main()': a.cc:4:14: error: 'stack' is not a member of 'std' 4 | std::stack<int> railroad; | ^~~~~ a.cc:2:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>' 1 | #include <iostream> +++ |+#include <stack> 2 | a.cc:4:20: error: expected primary-expression before 'int' 4 | std::stack<int> railroad; | ^~~ a.cc:9:25: error: 'railroad' was not declared in this scope 9 | railroad.push(incar); | ^~~~~~~~ a.cc:11:38: error: 'railroad' was not declared in this scope 11 | std::cout << railroad.top() << std::endl; | ^~~~~~~~
s424828238
p00013
C++
#include <iostream> #include <deque> int main(){ std::deque<int> que; int tmp; while(std::cin >> tmp){ if(tmp == 0) std::cout << que.pop() << std::endl; else que.push(tmp); } return 0; }
a.cc: In function 'int main()': a.cc:8:47: error: 'class std::deque<int>' has no member named 'pop' 8 | if(tmp == 0) std::cout << que.pop() << std::endl; | ^~~ a.cc:9:26: error: 'class std::deque<int>' has no member named 'push' 9 | else que.push(tmp); | ^~~~
s634374541
p00013
C++
#include <iostream> #include <deque> int main(){ std::deque<int> que; int tmp; while(std::cin >> tmp){ if(tmp == 0) std::cout << que.pop() << std::endl; else que.push(tmp); } return 0; }
a.cc: In function 'int main()': a.cc:8:47: error: 'class std::deque<int>' has no member named 'pop' 8 | if(tmp == 0) std::cout << que.pop() << std::endl; | ^~~ a.cc:9:26: error: 'class std::deque<int>' has no member named 'push' 9 | else que.push(tmp); | ^~~~
s431300656
p00013
C++
#include <iostream> #include <deque> int main(){ std::deque<int> que; int tmp; while(std::cin >> tmp){ if(tmp == 0) std::cout << que.pop_back() << std::endl; else que.push_back(tmp); } return 0; }
a.cc: In function 'int main()': a.cc:8:40: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 8 | if(tmp == 0) std::cout << que.pop_back() << std::endl; | ~~~~~~~~~ ^~ ~~~~~~~~~~~~~~ | | | | | void | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'void' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'void' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'void' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'void' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'void' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'void' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'void' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'void' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'void' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'void' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'void' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'void' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'void' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'void' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_str
s490399137
p00013
C++
#include <iostream> #include <deque> int main(){ std::deque<int> que; int tmp; while(std::cin >> tmp){ if(tmp == 0) std::cout << que.pop_back() << std::endl; else que.push_back(tmp); } return 0; }
a.cc: In function 'int main()': a.cc:8:40: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 8 | if(tmp == 0) std::cout << que.pop_back() << std::endl; | ~~~~~~~~~ ^~ ~~~~~~~~~~~~~~ | | | | | void | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'void' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'void' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'void' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'void' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'void' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'void' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'void' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'void' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'void' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'void' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'void' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'void' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'void' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'void' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_str
s262522718
p00013
C++
q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())})
a.cc:1:1: error: 'q' does not name a type 1 | q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())}) | ^ a.cc:1:13: error: expected constructor, destructor, or type conversion before '(' token 1 | q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())}) | ^ a.cc:1:122: error: expected unqualified-id before ')' token 1 | q=[];require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){i?q.push(i):console.log(q.pop())}) | ^
s583765288
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j; for(int i=0;;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(){ if(j1!=0){ printf("%d",a[j1]); break; } j--; } } }
a.cc: In function 'int main()': a.cc:9:7: error: expected primary-expression before ')' token 9 | while(){ | ^ a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'? 10 | if(j1!=0){ | ^~ | j a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s435342510
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j; for(int i=0;;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(){ if(j1!=0){ printf("%d",a[j1]); break; } j--; } } }
a.cc: In function 'int main()': a.cc:9:7: error: expected primary-expression before ')' token 9 | while(){ | ^ a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'? 10 | if(j1!=0){ | ^~ | j a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s358376342
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j; for(int i=0;;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(){ if(j1!=0){ printf("%d",a[j1]); break; } j--; } } }
a.cc: In function 'int main()': a.cc:9:7: error: expected primary-expression before ')' token 9 | while(){ | ^ a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'? 10 | if(j1!=0){ | ^~ | j a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s761555259
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j; for(int i=0;;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(){ if(j1!=0){ printf("%d",a[j1]); break; } j--; } a[j-1]=0; } }
a.cc: In function 'int main()': a.cc:9:7: error: expected primary-expression before ')' token 9 | while(){ | ^ a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'? 10 | if(j1!=0){ | ^~ | j a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s545022007
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j; for(int i=0;;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(){ if(j1!=0){ printf("%d",a[j1]); break; } j--; } a[j-1]=0; if(j-1==0){ break; } } }
a.cc: In function 'int main()': a.cc:9:7: error: expected primary-expression before ')' token 9 | while(){ | ^ a.cc:10:4: error: 'j1' was not declared in this scope; did you mean 'j'? 10 | if(j1!=0){ | ^~ | j a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s491247898
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j; for(int i=0;;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(){ if(j-1!=0){ printf("%d",a[j-1]); break; } j--; } a[j-1]=0; if(j-1==0){ break; } } }
a.cc: In function 'int main()': a.cc:9:7: error: expected primary-expression before ')' token 9 | while(){ | ^ a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s037922271
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j,a=0; for(int i=0;i<100;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(a=0){ if(j-1!=0){ printf("%d",a[j-1]); a=1; } j--; } a=0; a[j]=0; if(j-1==0){ i=101; } } }
a.cc: In function 'int main()': a.cc:4:7: error: conflicting declaration 'int a' 4 | int j,a=0; | ^ a.cc:3:5: note: previous declaration as 'int a [100]' 3 | int a[100]; | ^ a.cc:9:8: error: incompatible types in assignment of 'int' to 'int [100]' 9 | while(a=0){ | ~^~ a.cc:12:2: error: incompatible types in assignment of 'int' to 'int [100]' 12 | a=1; | ~^~ a.cc:16:2: error: incompatible types in assignment of 'int' to 'int [100]' 16 | a=0; | ~^~ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s494427614
p00013
C++
#include<stdio.h> int main(){ int a[100]; int j,a=0; for(int i=0;i<100;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(a=0){ if(j-1!=0){ printf("%d",a[j-1]); a=1; } j--; } a=0; a[j]=0; if(j-1==0){ i=101; } } }
a.cc: In function 'int main()': a.cc:4:7: error: conflicting declaration 'int a' 4 | int j,a=0; | ^ a.cc:3:5: note: previous declaration as 'int a [100]' 3 | int a[100]; | ^ a.cc:9:8: error: incompatible types in assignment of 'int' to 'int [100]' 9 | while(a=0){ | ~^~ a.cc:12:2: error: incompatible types in assignment of 'int' to 'int [100]' 12 | a=1; | ~^~ a.cc:16:2: error: incompatible types in assignment of 'int' to 'int [100]' 16 | a=0; | ~^~ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s140824217
p00013
C++
#include<stdio.h> int main(){ int a[500]; int j,a=0; for(int i=0;i<500;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(a=0){ if(j-1!=0){ printf("%d\n",a[j-1]); a=1; } j--; } a=0; a[j]=0; if(j==0){ i=501; } } } return 0; }
a.cc: In function 'int main()': a.cc:4:7: error: conflicting declaration 'int a' 4 | int j,a=0; | ^ a.cc:3:5: note: previous declaration as 'int a [500]' 3 | int a[500]; | ^ a.cc:9:8: error: incompatible types in assignment of 'int' to 'int [500]' 9 | while(a=0){ | ~^~ a.cc:12:2: error: incompatible types in assignment of 'int' to 'int [500]' 12 | a=1; | ~^~ a.cc:16:2: error: incompatible types in assignment of 'int' to 'int [500]' 16 | a=0; | ~^~
s167979119
p00013
C++
#include<stdio.h> int main(){ int a[500]; int j,a=0; for(int i=0;i<500;i++){ scanf("%d",&a[i]); if(a[i]==0){ j=i; while(a=0){ if(j-1!=0){ printf("%d\n",a[j-1]); a=1; } j--; } a=0; a[j]=0; if(j==0){ i=501; } } } return 0; }
a.cc: In function 'int main()': a.cc:4:7: error: conflicting declaration 'int a' 4 | int j,a=0; | ^ a.cc:3:5: note: previous declaration as 'int a [500]' 3 | int a[500]; | ^ a.cc:9:8: error: incompatible types in assignment of 'int' to 'int [500]' 9 | while(a=0){ | ~^~ a.cc:12:2: error: incompatible types in assignment of 'int' to 'int [500]' 12 | a=1; | ~^~ a.cc:16:2: error: incompatible types in assignment of 'int' to 'int [500]' 16 | a=0; | ~^~
s181069543
p00013
C++
import java.util.Scanner; import java.util.Stack; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); Stack<Integer> stack = new Stack<Integer>(); while (scn.hasNext()) { int n = scn.nextInt(); if (n == 0) { System.out.println(stack.pop()); } else { stack.push(n); } } } }
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ 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.util.Stack; | ^~~~~~ 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 { | ^~~~~~
s952719135
p00013
C++
#include <stdio.h> int train[10]; int sp = 0; int empty() { return sp <= 0; } int size() { return sp; } int top() { return train[sp-1]; } void pop() { sp--; } void push(int v) { train[sp] = v; sp++; } int main(){ int num; while(1){ scanf("%d", &num); if(num == 0){ printf("%d\n", top()); pop(); }else{ push(num); } if(size() = 0) break; } return 0; }
a.cc: In function 'int main()': a.cc:37:12: error: lvalue required as left operand of assignment 37 | if(size() = 0) break; | ~~~~^~
s223587522
p00013
C++
#include <stdio.h> int train[10]; int sp = 0; int empty() { return sp <= 0; } int size() { return sp; } int top() { return train[sp-1]; } void pop() { sp--; } void push(int v) { train[sp] = v; sp++; } int main(){ int out[10]; int num, i = 0; while(1){ scanf("%d", &num); if(num == 0){ out[i] = top(); i++; pop(); }else if(1 <= num && num <= 10){ push(num); } if(size() == 0) break; } for(i = 0, i < 10, i++){ printf("%d\n", out[i]); } return 0; }
a.cc: In function 'int main()': a.cc:41:25: error: expected ';' before ')' token 41 | for(i = 0, i < 10, i++){ | ^ | ; a.cc:44:3: error: expected primary-expression before 'return' 44 | return 0; | ^~~~~~ a.cc:43:4: error: expected ';' before 'return' 43 | } | ^ | ; 44 | return 0; | ~~~~~~ a.cc:44:3: error: expected primary-expression before 'return' 44 | return 0; | ^~~~~~ a.cc:43:4: error: expected ')' before 'return' 43 | } | ^ | ) 44 | return 0; | ~~~~~~ a.cc:41:6: note: to match this '(' 41 | for(i = 0, i < 10, i++){ | ^
s590757828
p00013
C++
#include <stdio.h> int main(void) { int a[10]; int b[10]; int c; int i=0; int t=0; do{ scanf_s("%d",&c); if (c >= 1 && c <= 10){ a[t] = c; t++; } else if (c == 0){ t--; b[i] = a[t]; i++; } } while (t > 0); printf("\n"); for (c = 0; c < i; c++){ printf("%d\n",b[c]); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 11 | scanf_s("%d",&c); | ^~~~~~~ | scanf
s229412932
p00013
C++
#include <iostream> using namespace std; int a[11], b, t; int main() { cin>>a[0]; t=1; c=0; while(cin>>b) { if(b>0) { a[t]=b; t++; }else { cout<<a[t-1]<<endl; t--; } } return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: 'c' was not declared in this scope 9 | c=0; | ^
s477972404
p00013
C++
#include<iostream> using namespace std;main(){int i=0,num,a[10];while(cin>>n){if(n)a[i++]=n;else cout<<a[--i]<<endl;}}
a.cc:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | using namespace std;main(){int i=0,num,a[10];while(cin>>n){if(n)a[i++]=n;else cout<<a[--i]<<endl;}} | ^~~~ a.cc: In function 'int main()': a.cc:2:57: error: 'n' was not declared in this scope 2 | using namespace std;main(){int i=0,num,a[10];while(cin>>n){if(n)a[i++]=n;else cout<<a[--i]<<endl;}} | ^
s277330084
p00013
C++
import java.util.ArrayDeque; import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner scan = new Scanner(System.in); ArrayDeque<Integer> stack = new ArrayDeque<Integer>(); int n; while (scan.hasNext()) { n = Integer.parseInt(scan.nextLine()); if (n == 0) { System.out.println(stack.pop()); } else { stack.push(n); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayDeque; | ^~~~~~ 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.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s154194368
p00013
C++
#include <iostream> #include <stack> int main(){ stack<int> rail; int buf; // repeat until "cin" fails. while (cin >> buf) { if (buf == 0) { // train goes out. cout << rail.top(); rail.pop(); } else{ // train comes in. rail.push(buf); } } return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'stack' was not declared in this scope; did you mean 'std::stack'? 6 | stack<int> rail; | ^~~~~ | std::stack In file included from /usr/include/c++/14/stack:63, from a.cc:3: /usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std::stack' declared here 99 | class stack | ^~~~~ a.cc:6:11: error: expected primary-expression before 'int' 6 | stack<int> rail; | ^~~ a.cc:10:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | while (cin >> buf) { | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:12:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 12 | cout << rail.top(); | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:12:21: error: 'rail' was not declared in this scope 12 | cout << rail.top(); | ^~~~ a.cc:16:13: error: 'rail' was not declared in this scope 16 | rail.push(buf); | ^~~~
s854033143
p00013
C++
#include <math.h> #include <algorithm> #include <iomanip> #include <string> #include <stack> using namespace std; int main(){ int i; stack<int> s; while (cin >> i) { if (i == 0) { cout << s.top() << endl; s.pop(); } else { s.push(i); } } return 0; }
a.cc: In function 'int main()': a.cc:11:16: error: 'cin' was not declared in this scope 11 | while (cin >> i) { | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <stack> +++ |+#include <iostream> 6 | using namespace std; a.cc:13:25: error: 'cout' was not declared in this scope 13 | cout << s.top() << endl; | ^~~~ a.cc:13:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s765132355
p00013
C++
import java.io.*; public class Main{ public static void main(String args[]) throws IOException{ BufferedReader bf = new BufferedReader( new InputStreamReader(System.in)); int i = 0, j = 0,x; int order[] = new int[10]; int exit[] = new int[1000]; String str; while((str = bf.readLine()) != null){ x = Integer.parseInt(str); if(x != 0){ order[i] = x; i++; } else { exit[j] = order[i-1]; j++; i--; } } for(int c = 0; c < j; c++){ System.out.println(exit[c]); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:2: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s413391833
p00013
C++
//#define scanf_s scanf #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 100 int main(void) { int n, now = 0; int list[MAX] = { 0 }; do{ scanf_s("%d", &n); if (n != 0) { list[now] = n; ++now; } else { --now; printf("%d\n", list[now]); } } while (now != 0); }
a.cc: In function 'int main()': a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s778375209
p00013
C++
#include<iostream> #include<stack> using namespace std; int main() { int x; stack<int> st; while (cin >> x) { if (x) { st.push(n); } else { cout << st.top() << endl; st.pop(); } } return 0; }
a.cc: In function 'int main()': a.cc:11:33: error: 'n' was not declared in this scope 11 | st.push(n); | ^
s970786662
p00013
C++
#include<iostream> #include<vector> using namespace std; int main(){ int a; vector<int> s; vector<int> t; while(cin>>a){ if(a!=0){ s.push_back(a); }else{ s.pop_back(a); t.push_back(s[s.size()-1]); s.pop_back(s[s.size()-1]); } } for(int i=0;i<t.size();i++){ cout << t[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:23: error: no matching function for call to 'std::vector<int>::pop_back(int&)' 12 | s.pop_back(a); | ~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate: 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]' 1324 | pop_back() _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate expects 0 arguments, 1 provided a.cc:14:23: error: no matching function for call to 'std::vector<int>::pop_back(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 14 | s.pop_back(s[s.size()-1]); | ~~~~~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate: 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]' 1324 | pop_back() _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate expects 0 arguments, 1 provided
s259494233
p00013
C++
{ stack<int>a; int b; scanf("%d",&b); a.push(b); while(cin>>b){ if(b)a.push(b); else {printf("%d\n",a.top());a.pop();} } }
a.cc:1:1: error: expected unqualified-id before '{' token 1 | { | ^
s890773263
p00013
C++
#include<stdio.h> #include <stack> int main(){ stack<int> st; int n, a; while(cin >> n){ if(n!=0){ st.push( n ); }else{ a = st.top(); cout << a << endl; st.pop(); } } }
a.cc: In function 'int main()': a.cc:5:9: error: 'stack' was not declared in this scope; did you mean 'std::stack'? 5 | stack<int> st; | ^~~~~ | std::stack In file included from /usr/include/c++/14/stack:63, from a.cc:2: /usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std::stack' declared here 99 | class stack | ^~~~~ a.cc:5:15: error: expected primary-expression before 'int' 5 | stack<int> st; | ^~~ a.cc:8:15: error: 'cin' was not declared in this scope 8 | while(cin >> n){ | ^~~ a.cc:10:25: error: 'st' was not declared in this scope; did you mean 'std'? 10 | st.push( n ); | ^~ | std a.cc:12:29: error: 'st' was not declared in this scope; did you mean 'std'? 12 | a = st.top(); | ^~ | std a.cc:13:25: error: 'cout' was not declared in this scope 13 | cout << a << endl; | ^~~~ a.cc:13:38: error: 'endl' was not declared in this scope 13 | cout << a << endl; | ^~~~
s319737902
p00013
C++
#include<stdio.h> #include <iostream> #include <stack> int main(){ stack<int> st; int n, a; while(cin >> n){ if(n!=0){ st.push( n ); }else{ a = st.top(); cout << a << endl; st.pop(); } } }
a.cc: In function 'int main()': a.cc:6:9: error: 'stack' was not declared in this scope; did you mean 'std::stack'? 6 | stack<int> st; | ^~~~~ | std::stack In file included from /usr/include/c++/14/stack:63, from a.cc:3: /usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std::stack' declared here 99 | class stack | ^~~~~ a.cc:6:15: error: expected primary-expression before 'int' 6 | stack<int> st; | ^~~ a.cc:9:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | while(cin >> n){ | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:11:25: error: 'st' was not declared in this scope; did you mean 'std'? 11 | st.push( n ); | ^~ | std a.cc:13:29: error: 'st' was not declared in this scope; did you mean 'std'? 13 | a = st.top(); | ^~ | std a.cc:14:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout << a << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:14:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 14 | cout << a << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s242231278
p00013
C++
#include <iostream> #include <stack> using namespace std; int main() { int num; stack<int> st; while(!cin.eof()) { cin >> num; if(num==0) { cout << stack.top() << endl; st.pop(); } else { st.push(num); } } return 0; }
a.cc: In function 'int main()': a.cc:17:38: error: missing template arguments before '.' token 17 | cout << stack.top() << endl; | ^
s396912296
p00013
C++
#include <iostream> #include <stack> using namespace std; int main() { int num; stack<int> stack; while(cin >> num;) { if(num==0) { cout << stack.top() << endl; stack.pop(); } else { stack.push(num); } } return 0; }
a.cc: In function 'int main()': a.cc:10:25: error: expected ')' before ';' token 10 | while(cin >> num;) | ~ ^ | ) a.cc:10:26: error: expected primary-expression before ')' token 10 | while(cin >> num;) | ^
s506838186
p00013
C++
#include<iostream> #include<stack> using namespace std; int main(){ stack<int> s; int n; cin>>n; s.push(n); while(cin>>n{ if(n==0){ cout<<s.top()<<endl; s.pop(); } else{ s.push(n); } } }
a.cc: In function 'int main()': a.cc:9:17: error: expected ')' before '{' token 9 | while(cin>>n{ | ~ ^ | )
s363971981
p00013
C++
list = {} while True: try: num = int(input()) if num == 0: print(list.pop()) else: list.append(num) except: break
a.cc:1:1: error: 'list' does not name a type 1 | list = {} | ^~~~ a.cc:2:1: error: expected unqualified-id before 'while' 2 | while True: | ^~~~~
s011757177
p00013
C++
#include <iostream> #include <stack> int main(){ std::stack<int> st; //car's number int num = 0; //Until the end of input while(std::cin >> num){ //if num = 0, output and delete if(num == 0){ std::cout << st.pop() << std::endl; //if num != 0, input } else { st.push(num); } } }
a.cc: In function 'int main()': a.cc:14:35: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 14 | std::cout << st.pop() << std::endl; | ~~~~~~~~~ ^~ ~~~~~~~~ | | | | | void | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'void' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'void' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'void' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'void' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'void' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'void' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'void' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'void' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'void' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'void' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'void' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'void' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'void' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'void' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 124 | basic_ostream<_CharT,
s447131083
p00013
C++
#include <iostream> #include <stack> int main(){ std::stack<int> st; //car's number int num = 0; //Until the end of input while(std::cin >> num){ //if num = 0, output and delete if(num == 0){ std::cout << st.pop() << std::endl; //if num != 0, input } else { st.push(num); } } }
a.cc: In function 'int main()': a.cc:14:35: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 14 | std::cout << st.pop() << std::endl; | ~~~~~~~~~ ^~ ~~~~~~~~ | | | | | void | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'void' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'void' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'void' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'void' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'void' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'void' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'void' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'void' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'void' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'void' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'void' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'void' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'void' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'void' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 124 | basic_ostream<_CharT,
s140889077
p00013
C++
#include<iostream> #define MAX 256 int main(void){ int i=0,j=0; int a[MAX]; int ans[MAX]; while(cin>>x){ if(x==0){ ans[j]=a[i-1]; j++; i--; }else{ ans[i]=x; i++; } } for(int i=0;i<j;i++){ cout<<ans[i]<<endl } }
a.cc: In function 'int main()': a.cc:10:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | while(cin>>x){ | ^~~ | 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:10:20: error: 'x' was not declared in this scope 10 | while(cin>>x){ | ^ a.cc:24:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 24 | cout<<ans[i]<<endl | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:24:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 24 | cout<<ans[i]<<endl | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s415587038
p00013
C++
#include<stdio.h> const int SIZE=100; int data[SIZE]; int sp=0; int size(){ return sp; } int empty(){ return sp<=0; } int top(){ return data[sp-1]; } void pop(){ sp--; } void push(int v){ data[sp]=v; sp++; } int main(){ int n,k; while(1){ scanf("%d",&n); if(n==0){ printf("%d\n",top()); pop(); }else{ push(n); } if(n==empty)break; } return 0; }
a.cc: In function 'int main()': a.cc:31:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 31 | if(n==empty)break; | ~^~~~~~~
s417858315
p00013
C++
#include <stdio.h> const int SIZE = 100; int data[SIZE]; int sp= 0; int size(){ return sp; } int top(){ return data[sp-1]; } void pop(){ sp--; } void push(int v){ data[sp] = v; sp++; } int main(){ int v; while(scanf("%d", &v)) != EOF){ if(v != 0){ push(v); } if(v == 0){ pop(); } top(); } }
a.cc: In function 'int main()': a.cc:23:25: error: expected primary-expression before '!=' token 23 | while(scanf("%d", &v)) != EOF){ | ^~
s347848098
p00013
C++
#include<stdio.h> const int SIZE=100; int data[SIZE]; int sp=0; int size(){ return sp; } int empty(){ return sp<=0; } int isfull(){ return sp>=SIZE; } int top(){ return data[sp-1]; } void pop(){ sp--; } void push(int v){ data[sp]=v; sp++; } int main(){ int k,n; for(k=0;k<100;k++){ scanf("%d",&n); if(!empty(){ if(n==0){ printf("%d\n",top()); pop(); } }else{ if(!isfull()){ push(n); } } } return 0; }
a.cc: In function 'int main()': a.cc:28:16: error: expected ')' before '{' token 28 | if(!empty(){ | ~ ^ | ) a.cc:38:3: error: expected primary-expression before '}' token 38 | } | ^
s662858041
p00013
C++
#include <stdio.h> const int SIZE = 100; int data[SIZE]; int sp= 0; void pop(){ sp--; } void push(int v){ data[sp] = v; sp++; } int main(){ int v; while(scanf("%d", &v) != EOF){ if(v != 0){ push(v); } if(v == 0){ printf("%d\n", top()); pop(); } } return 0; }
a.cc: In function 'int main()': a.cc:22:19: error: 'top' was not declared in this scope; did you mean 'pop'? 22 | printf("%d\n", top()); | ^~~ | pop
s389204791
p00013
C++
#include <stdio.h> const int SIZE = 100; int data[SIZE]; int sp= 0; void pop(){ sp--; } void push(int v){ data[sp] = v; sp++; } int main(){ int v; while(scanf("%d", &v) != EOF){ if(v != 0){ push(v); } if(v == 0){ printf("%d\n", top()); pop(); } } return 0; }
a.cc: In function 'int main()': a.cc:22:19: error: 'top' was not declared in this scope; did you mean 'pop'? 22 | printf("%d\n", top()); | ^~~ | pop
s326941144
p00013
C++
#include<iostream> #include<stack> using namespace std; int main(){ stack<int> s; int x; cin >> x; s.push(x); while(!s.empty()){ cin >> x; if(x==0){ cout << st.top() << endl; st.pop(); } else{ s.push(x); } } }
a.cc: In function 'int main()': a.cc:12:21: error: 'st' was not declared in this scope; did you mean 's'? 12 | cout << st.top() << endl; | ^~ | s
s436169133
p00013
C++
#include <stdio.h> int main(void) { std::stack<int> st; int n; while(scanf("%d", &n) != EOF) { if(n) st.push(n); else { printf("%d\n", st.top()); st.pop(); } } return 0; }
a.cc: In function 'int main()': a.cc:4:8: error: 'stack' is not a member of 'std' 4 | std::stack<int> st; | ^~~~~ a.cc:2:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>' 1 | #include <stdio.h> +++ |+#include <stack> 2 | a.cc:4:14: error: expected primary-expression before 'int' 4 | std::stack<int> st; | ^~~ a.cc:7:11: error: 'st' was not declared in this scope; did you mean 'std'? 7 | if(n) st.push(n); | ^~ | std a.cc:9:22: error: 'st' was not declared in this scope; did you mean 'std'? 9 | printf("%d\n", st.top()); | ^~ | std
s568350098
p00013
C++
#include <iostream> int stack[100]; int point=0; void push(int p){ stack[point]=0; ++point; } void pop(){ std:cout << stack[point] << endl; --point; } int main(){ int num; for(int i=0;i<100;i++){ std:cin >> num; if(num==0) pop(); else push(num); } return 0; }
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc: In function 'void pop()': a.cc:12:13: error: 'cout' was not declared in this scope 12 | std:cout << stack[point] << endl; | ^~~~ a.cc:12:37: error: 'endl' was not declared in this scope 12 | std:cout << stack[point] << endl; | ^~~~ a.cc: In function 'int main()': a.cc:20:21: error: 'cin' was not declared in this scope 20 | std:cin >> num; | ^~~
s226809468
p00013
C++
#include <iostream> int stack[100]; int point=0; void push(int p){ stack[point]=0; ++point; } void pop(){ std::cout << stack[point] << std::endl; --point; } int main(){ int num; for(int i=0;i<100;i++){ std::cin >> num; if(num==0) pop(); else push(num); } return 0; }
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc: In function 'void pop()': a.cc:12:14: error: 'cout' is not a member of 'std' 12 | std::cout << stack[point] << std::endl; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #include <iostream> a.cc:12:43: error: 'endl' is not a member of 'std' 12 | std::cout << stack[point] << std::endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #include <iostream> a.cc: In function 'int main()': a.cc:20:22: error: 'cin' is not a member of 'std' 20 | std::cin >> num; | ^~~ a.cc:20:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s296016280
p00013
C++
#include <iostream> #include <array> std::array<u_int, 100> stack; int point=0; void push(int p){ stack[point]=p; ++point; } void pop(){ std::cout << stack[point] << std::endl; --point; } int main(){ int num; for(int i=0;i<100;i++){ std::cin >> num; if(num==0) pop(); else push(num); } return 0; }
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc:4:12: error: 'u_int' was not declared in this scope; did you mean 'int'? 4 | std::array<u_int, 100> stack; | ^~~~~ | int a.cc:4:22: error: template argument 1 is invalid 4 | std::array<u_int, 100> stack; | ^ a.cc: In function 'void push(int)': a.cc:8:14: error: invalid types 'int[int]' for array subscript 8 | stack[point]=p; | ^ a.cc: In function 'void pop()': a.cc:13:14: error: 'cout' is not a member of 'std' 13 | std::cout << stack[point] << std::endl; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <array> +++ |+#include <iostream> 3 | a.cc:13:27: error: invalid types 'int[int]' for array subscript 13 | std::cout << stack[point] << std::endl; | ^ a.cc:13:43: error: 'endl' is not a member of 'std' 13 | std::cout << stack[point] << std::endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <array> +++ |+#include <ostream> 3 | a.cc: In function 'int main()': a.cc:21:22: error: 'cin' is not a member of 'std' 21 | std::cin >> num; | ^~~ a.cc:21:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s006291065
p00013
C++
#include <iostream> #include <array> std::array<u_int, 100> stack; int point=0; void push(int p){ stack[point]=p; ++point; } void pop(){ std::cout << stack[point] << std::endl; --point; } int main(){ int num; for(int i=0;i<100;i++){ std::cin >> num; if(num==0) pop(); else push(num); } return 0; }
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc:4:12: error: 'u_int' was not declared in this scope; did you mean 'int'? 4 | std::array<u_int, 100> stack; | ^~~~~ | int a.cc:4:22: error: template argument 1 is invalid 4 | std::array<u_int, 100> stack; | ^ a.cc: In function 'void push(int)': a.cc:8:14: error: invalid types 'int[int]' for array subscript 8 | stack[point]=p; | ^ a.cc: In function 'void pop()': a.cc:13:14: error: 'cout' is not a member of 'std' 13 | std::cout << stack[point] << std::endl; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <array> +++ |+#include <iostream> 3 | a.cc:13:27: error: invalid types 'int[int]' for array subscript 13 | std::cout << stack[point] << std::endl; | ^ a.cc:13:43: error: 'endl' is not a member of 'std' 13 | std::cout << stack[point] << std::endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <array> +++ |+#include <ostream> 3 | a.cc: In function 'int main()': a.cc:21:22: error: 'cin' is not a member of 'std' 21 | std::cin >> num; | ^~~ a.cc:21:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s014464002
p00013
C++
#include<stack> #include<iostream> using namespace std; void main(){ stack<int> train; int n; while(cin >> n){ if(n != 0) train.push(n); else{ cout << train.top() << endl; train.pop(); } } }
a.cc:4:1: error: '::main' must return 'int' 4 | void main(){ | ^~~~
s759036665
p00013
C++
n,*a=&n;main(){for(;~scanf("%s",a);)*a%8?a++:puts(--a);}
a.cc:1:1: error: 'n' does not name a type 1 | n,*a=&n;main(){for(;~scanf("%s",a);)*a%8?a++:puts(--a);} | ^ a.cc:1:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | n,*a=&n;main(){for(;~scanf("%s",a);)*a%8?a++:puts(--a);} | ^~~~ a.cc: In function 'int main()': a.cc:1:33: error: 'a' was not declared in this scope 1 | n,*a=&n;main(){for(;~scanf("%s",a);)*a%8?a++:puts(--a);} | ^ a.cc:1:22: error: 'scanf' was not declared in this scope 1 | n,*a=&n;main(){for(;~scanf("%s",a);)*a%8?a++:puts(--a);} | ^~~~~ a.cc:1:46: error: 'puts' was not declared in this scope 1 | n,*a=&n;main(){for(;~scanf("%s",a);)*a%8?a++:puts(--a);} | ^~~~
s880252845
p00013
C++
#include <iostream> #include <vector> int main(int argc,char* argv[]){ std::vector<int> vec(1000); while(!std::cin.eof()){ int temp; std::cin >> temp; if(temp == 0){ std::cout << vec.back() << std::endl; vec.pop_back(); continue; }else{ vec.push_back(temp); continue; } } return 0;
a.cc: In function 'int main(int, char**)': a.cc:20:12: error: expected '}' at end of input 20 | return 0; | ^ a.cc:4:32: note: to match this '{' 4 | int main(int argc,char* argv[]){ | ^
s897749343
p00013
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define REP(i,a,b) for(i=a;i<b;i++) #define rep(i,n) REP(i,0,n) #define PUSH intStackPush #define POP intStackPop #define TOP intStackTop #define FREE intStackFree typedef struct stack{ int data; struct stack* next; }stack; stack *top = NULL; stack* makeNewStack(int data){ stack *new = (stack*)malloc(sizeof(stack)); new->data = data; new->next = NULL; return new; } void intStackPush(int data){ stack *new = makeNewStack(data); if(top != NULL){ new->next = top; top = new; } else top = new; } void intStackPop(){ stack *temp; temp = top; top = top->next; free(temp); } int intStackTop(){ return top->data;} void intStackFree(){ while(top != NULL) intStackPop();} int main(){ int in; while(scanf("%d", &in) != EOF){ if(in == 0){ printf("%d\n",TOP()); POP(); } else PUSH(in); } FREE(); return 0; }
a.cc: In function 'stack* makeNewStack(int)': a.cc:19:10: error: expected unqualified-id before 'new' 19 | stack *new = (stack*)malloc(sizeof(stack)); | ^~~ a.cc:20:6: error: expected type-specifier before '->' token 20 | new->data = data; | ^~ a.cc:21:6: error: expected type-specifier before '->' token 21 | new->next = NULL; | ^~ a.cc:22:13: error: expected type-specifier before ';' token 22 | return new; | ^ a.cc: In function 'void intStackPush(int)': a.cc:26:10: error: expected unqualified-id before 'new' 26 | stack *new = makeNewStack(data); | ^~~ a.cc:27:23: error: expected type-specifier before '->' token 27 | if(top != NULL){ new->next = top; top = new; } | ^~ a.cc:27:46: error: expected type-specifier before ';' token 27 | if(top != NULL){ new->next = top; top = new; } | ^ a.cc:28:17: error: expected type-specifier before ';' token 28 | else top = new; | ^
s462086408
p00013
C++
#include <iostream> #include <stdio.h> #include <stack> using namespace std; stack<int> s; int ac; int main(void) { s.clear(); while(~scanf("%d", &ac)) { if(ac == 0) { cout << s.top() << endl; s.pop(); } else { s.push(ac); } } return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: 'class std::stack<int>' has no member named 'clear' 11 | s.clear(); | ^~~~~
s356002358
p00013
C++
#include<iostream> using namespace std; int main(){ int a[]={0,0,0,0,0,0,0,0,0,0}; int b; while(cin>>b){ if(b==0){ cout<<a[0]; for(int i=0;i<9;i++){ a[i]=a[i+1];}} else{ for(int i=0;i<8;i++){ a[9-i]=a[8-i]} a[0]=b;}}
a.cc: In function 'int main()': a.cc:13:14: error: expected ';' before '}' token 13 | a[9-i]=a[8-i]} | ^ | ; a.cc:14:10: error: expected '}' at end of input 14 | a[0]=b;}} | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s151238291
p00013
C++
#include<iostream> using namespace std; int main(){ int a[]={0,0,0,0,0,0,0,0,0,0}; int b; while(cin>>b){ if(b==0){ cout<<a[0]; for(int i=0;i<9;i++){ a[i]=a[i+1];}} else{ for(int i=0;i<8;i++){ a[9-i]=a[8-i];} a[0]=b;}}
a.cc: In function 'int main()': a.cc:14:10: error: expected '}' at end of input 14 | a[0]=b;}} | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s061602291
p00013
C++
#include<iostream> using namespace std; int main(){ int a[]={0,0,0,0,0,0,0,0,0,0}; int b; while(cin>>b){ if(b==0){ cout<<a[0]; for(int i=0;i<9;i++){ a[i]=a[i+1];}} else{ for(int i=0;i<9;i++){ a[9-i]=a[8-i];} a[0]=b;}}
a.cc: In function 'int main()': a.cc:14:10: error: expected '}' at end of input 14 | a[0]=b;}} | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s154020388
p00013
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <stack> #include <queue> #include <cstring> #include <climits> #include <cmath> #include <cfloat> #define FOR(i,b,n) for(int i=b;i<n;i++) #define CLR(mat) memset(mat, 0, sizeof(mat)) #define INF 1<<25 #define LIM 1000000 using namespace std; stack<int> st; int a; int main() { cin >> a; st.push(a); while(!st.empty()) { cin >> a; if( a == 0 ) { cout << st.top << endl; st.pop(); } else st.push(a); } return 0; }
a.cc: In function 'int main()': a.cc:34:30: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 34 | cout << st.top << endl; | ~~~~ ^~ ~~~~~~ | | | | | <unresolved overloaded function type> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::n
s386794223
p00013
C++
#include <iostream> #include <stack> #include <vector> using namespace std; int main() { stack<int> car; vector<int> outlist; while( !car.empty() || outlist.empty() ) { int carnum; cin >> carnum; if(carnum) { car.push(carnum); } else { outlist.push_back(car.top()); car.pop(); } } cout << outlist[i] << '\n'; for(size_t i=0; i<outlist.size(); ++i) { cout << outlist[i] << '\n'; } }
a.cc: In function 'int main()': a.cc:26:25: error: 'i' was not declared in this scope 26 | cout << outlist[i] << '\n'; | ^
s137663604
p00013
C++
#include<cstdio> #include<queue> using namespace std; int main(){ int x; queue<int> q; while(scanf("%d", &x) != EOF){ if(x == 0){ printf("%d\n", q.top()); q.pop(); } else{ q.push(x); } } return 0; }
a.cc: In function 'int main()': a.cc:10:24: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 10 | printf("%d\n", q.top()); | ^~~ | pop
s592241482
p00013
C++
#include<iostream> #include<vector> using namespace std; int main() { int a; vector<int> array; for(;cin >> a;) { if(a==0) { cout << array[array.size()-1] << endl; array.pop(); } else array.push_back(a); } }
a.cc: In function 'int main()': a.cc:15:7: error: 'class std::vector<int>' has no member named 'pop' 15 | array.pop(); | ^~~
s930332917
p00013
C++
const int N=10; using namespace std; int main(){ int a[N]; int n=0; while (!cin.eof()){ int t; cin>>t; if (t) a[n++]=t; else cout<<a[--n]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: 'cin' was not declared in this scope 8 | while (!cin.eof()){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | const int N=10; a.cc:12:14: error: 'cout' was not declared in this scope 12 | else cout<<a[--n]<<endl; | ^~~~ a.cc:12:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:28: error: 'endl' was not declared in this scope 12 | else cout<<a[--n]<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | const int N=10;
s291140938
p00013
C++
#include <iostream> #include <stack> #include <cstdio> using namespace std; int main(){ stack<int> st; int a; while(cin>>a){ if(a)st.push(a); else {printf("%d\n",st.top()); st.pop(); } } } return 0; }
a.cc:17:3: error: expected unqualified-id before 'return' 17 | return 0; | ^~~~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s664352161
p00013
C++
#include<iostream> int main(){int a,c=0,s[12];while(std::cin>>a){if(a!=0)s[c++]=a;else std::cout<<s[--c]<<"\n"}return 0;}
a.cc: In function 'int main()': a.cc:2:92: error: expected ';' before '}' token 2 | int main(){int a,c=0,s[12];while(std::cin>>a){if(a!=0)s[c++]=a;else std::cout<<s[--c]<<"\n"}return 0;} | ^ | ;
s393475223
p00013
C++
#include<iostream>int main(){int a,c=0,s[12];while(std::cin>>a){if(a!=0)s[c++]=a;else std::cout<<s[--c]<<"\n";}return 0;}
a.cc:1:23: warning: extra tokens at end of #include directive 1 | #include<iostream>int main(){int a,c=0,s[12];while(std::cin>>a){if(a!=0)s[c++]=a;else std::cout<<s[--c]<<"\n";}return 0;} | ^~~~ a.cc:1:9: fatal error: iostream>in: No such file or directory 1 | #include<iostream>int main(){int a,c=0,s[12];while(std::cin>>a){if(a!=0)s[c++]=a;else std::cout<<s[--c]<<"\n";}return 0;} | ^~~~~~~~~~~~~ compilation terminated.
s821313883
p00014
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ int d=sc.nextInt(); int n=600/d-1; int s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; System.out.println(s); } } }
Main.java:9: error: ')' expected int s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement int s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: ';' expected int s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement int s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ 4 errors
s978585897
p00014
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ int d=sc.nextInt(); int n=600/d-1; int s=n*(n+1)*(2n+1)*d*d*d/6; System.out.println(s); } } }
Main.java:9: error: ')' expected int s=n*(n+1)*(2n+1)*d*d*d/6; ^ Main.java:9: error: not a statement int s=n*(n+1)*(2n+1)*d*d*d/6; ^ Main.java:9: error: ';' expected int s=n*(n+1)*(2n+1)*d*d*d/6; ^ Main.java:9: error: not a statement int s=n*(n+1)*(2n+1)*d*d*d/6; ^ 4 errors
s671972466
p00014
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ int d=sc.nextInt(); int n=600/d-1; long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; System.out.println(s); } } }
Main.java:9: error: ')' expected long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: ';' expected long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ 4 errors
s225322211
p00014
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ int d=sc.nextInt(); int n=(600/d)-1; long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; System.out.println(s); } } }
Main.java:9: error: ')' expected long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: ';' expected long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ 4 errors
s338454160
p00014
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ long d=sc.nextLong(); long n=(600/d)-1; long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; System.out.println(s); } } }
Main.java:9: error: ')' expected long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: ';' expected long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ Main.java:9: error: not a statement long s=n*(n+1)*(2n+1)*Math.pow(d,3)/6; ^ 4 errors
s867871947
p00014
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ long d=sc.nextLong(); long n=(600/d)-1; long s=((2*Math.pow(n,3)+3*Math.pow(n,2)+n)*Math.pow(d,3))/6; System.out.println(s); } } }
Main.java:9: error: incompatible types: possible lossy conversion from double to long long s=((2*Math.pow(n,3)+3*Math.pow(n,2)+n)*Math.pow(d,3))/6; ^ 1 error
s456150839
p00014
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Integral { /** * ??????????????¨????????¢???????????¨????????? y = x^2 x = 600 * ?????????????¨???????????????? * @param args * @throws IOException * @throws NumberFormatException */ public static void main(String[] args) throws NumberFormatException, IOException { // TODO ????????????????????????????????????????????? InputStreamReader is = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(is); System.out.println("?????????????????????:"); int width = Integer.parseInt(br.readLine()); System.out.println(calcArea(width)); } public static int calcArea(int width) { // ????????¢????¨??????????????±????????????¨???????????? int num = 600 / width; // ?????????????????¢????????¨???????????? int sum = 0; int c = width; for (int i = 1; i <= num; i++) { // ?¨????????????????width // ????????????:f(b) =???x???2???= height int height = (int) Math.pow(c, 2); int menseki = width * height; System.out.println(width + "*" + height); sum += menseki; c += width; } return sum; } }
Main.java:5: error: class Integral is public, should be declared in a file named Integral.java public class Integral { ^ 1 error
s264741015
p00014
Java
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine()) != null){ int integral = 0; int j=1; int d = Integer.parseInt(str); int num = 600 / d; for(int i=0; i<num-1; i++){ integral = integral + (j*d)*(j*d)*d; j++; } System.out.println(integral); } }
Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws IOException ^ (use --enable-preview to enable unnamed classes) 1 error
s885158324
p00014
Java
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine()) != null){ int integral = 0; int j=1; int d = Integer.parseInt(str); int num = 600 / d; for(int i=0; i<num-1; i++){ integral = integral + (j*d)*(j*d)*d; j++; } System.out.println(integral); } }
Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) throws IOException ^ (use --enable-preview to enable unnamed classes) 1 error
s766537042
p00014
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ List<Integer> list = new ArrayList<Integer>(); while(scan.hasNext()){ int d = scan.nextInt(); int n600 = 600; int ans = 0; for(int x = d; x < n600; x += d){ ans += d * ((x * x); } list.add(ans); } for(int n : list){ System.out.printf("%d\n", n); } } }
Main.java:13: error: ')' expected ans += d * ((x * x); ^ 1 error
s323204262
p00014
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int d; while(true){ d=s.nextInt(); if(d != null) integral(d[i]); else System.exit(-1); } } public static void integral(int d){ int surface = 0; for(int i = 0;i < 600;i += d){ surface += i*i*d; } System.out.println(surface); } }
Main.java:9: error: bad operand types for binary operator '!=' if(d != null) integral(d[i]); ^ first type: int second type: <null> Main.java:9: error: cannot find symbol if(d != null) integral(d[i]); ^ symbol: variable i location: class Main Main.java:9: error: array required, but int found if(d != null) integral(d[i]); ^ 3 errors
s348973879
p00014
Java
import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while (sc.hasNextInt()) { int d = Integer.parseInt(br.readLine()); System.out.println(100 * (600 - d) * (1200 - d)); } } }
Main.java:10: error: cannot find symbol while (sc.hasNextInt()) { ^ symbol: variable sc location: class Main 1 error
s488068337
p00014
Java
import java.io.BufferedReader; import java.io.InputStreamReader; //public class Problem0014_Integral { public class Main { public static void main(String[] args) { try { // Problem0014_Integral test = new Problem0014_Integral(); Main test = new Main(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String line; CarStack stack = new CarStack(); while((line = reader.readLine()) != null) { try { int number = Integer.parseInt(line); System.out.println(test.getSummationArea(number)); } catch(NumberFormatException e) { break; } } } catch(Exception e) { e.printStackTrace(); } } int getSummationArea(int gap) { int x = 0; int summationArea = 0; while(x < 600) { //600‚Ì–ñ”‚ªInput‚̃f[ƒ^‚Å‚ ‚邱‚Æ‚©‚çAí‚É x=600 ‚ƂȂ鎞‚ªI–– summationArea += getArea(x, gap); x += gap; } return summationArea; } int getArea(int start, int width) { int height = start * start; int area = width * height; // System.out.println("x:" + start + "\theight:" + height + "\twidth:" + width + "\tarea:" + area); return area; } }
Main.java:14: error: cannot find symbol CarStack stack = new CarStack(); ^ symbol: class CarStack location: class Main Main.java:14: error: cannot find symbol CarStack stack = new CarStack(); ^ symbol: class CarStack location: class Main 2 errors
s348427146
p00014
Java
import java.util.Scanner; public class Integral { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext())calc(in); } private static void calc(Scanner in){ int sum=0,d = in.nextInt(); for(int i=1;d*i<=600-d;i++) sum+=Math.pow(d*i, 2)*d; System.out.println(sum); } }
Main.java:3: error: class Integral is public, should be declared in a file named Integral.java public class Integral { ^ 1 error
s511531236
p00014
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int d, x; while (sc.hasNext()) { area = 0; d = sc.nextInt(); for (int i = 0; i < 600; i += d) { x = i * i; area += x * d; } System.out.println(area); } } }
Main.java:8: error: cannot find symbol area = 0; ^ symbol: variable area location: class Main Main.java:12: error: cannot find symbol area += x * d; ^ symbol: variable area location: class Main Main.java:14: error: cannot find symbol System.out.println(area); ^ symbol: variable area location: class Main 3 errors
s480505193
p00014
C
#include <stdio.h> int main(void){ int d,h,i; scanf("%d",&d); for(i=0;i<600/d;i++){ h += d*i*d*i } printf("%d\n", h*d); return 0; }
main.c: In function 'main': main.c:9:17: error: expected ';' before '}' token 9 | h += d*i*d*i | ^ | ; 10 | } | ~
s641188804
p00014
C
#include <stdio.h> int main(void){ int d,h,i; while(EOF!=scanf("%d",&d)){ for(i=0;i<600/d;i++){ h += d*i*d*i } printf("%d\n", h*d); } return 0; }
main.c: In function 'main': main.c:9:17: error: expected ';' before '}' token 9 | h += d*i*d*i | ^ | ; 10 | } | ~
s313768831
p00014
C
#include<stdio.h> int function(int x){ return x * x; } int main(void){ int d; int i; while(scanf("%d",&d) != EOF){ s = 0; for(i=0;i<600;i+=d){ s += d*function(i); } printf("%d\n",s); } return 0; }
main.c: In function 'main': main.c:14:5: error: 's' undeclared (first use in this function) 14 | s = 0; | ^ main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
s581066867
p00014
C
#include "stdio.h" #include "math.h" int main() { int d, x; while(scanf("%d", &d) != EOF){ x = 0; for(int i = 0; i < 600; i += d){ x += (d * pow(i, 2.0)); } printf("%d\n", x); } return 0; }
/usr/bin/ld: /tmp/cctOJF4c.o: in function `main': main.c:(.text+0x4d): undefined reference to `pow' collect2: error: ld returned 1 exit status
s258175586
p00014
C
#include<stdio.h> int main() { int d, i, sum, length; while (scanf_s("%d", &d) != EOF) { length = 600; sum = 0; for (i = 1; i<length / d; i++) { sum += i*i*d*d; } printf("%d", sum*d); } }
main.c: In function 'main': main.c:6:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | while (scanf_s("%d", &d) != EOF) { | ^~~~~~~ | scanf
s163949478
p00014
C
#include <stdio.h> main() { long int x,ret; while(EOF != scanf("%ld",&n)) { ret = x* x * x * (600/x-1)*(600/x)*(600/x*2-1)/6; printf("%ld\n",ret); } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c: In function 'main': main.c:5:31: error: 'n' undeclared (first use in this function) 5 | while(EOF != scanf("%ld",&n)) | ^ main.c:5:31: note: each undeclared identifier is reported only once for each function it appears in
s131103058
p00014
C
#include<stdio.h> int main(){ int d,i,s_sum; cnt =0; s_sum=0; while(scanf("%d",&d)!=EOF){ for(i=1;(d*i)<=(600-d);i++) { s_sum=s_sum+d*(d*i)*(d*i); } printf("%d\n", s_sum); } return 0; }
main.c: In function 'main': main.c:6:3: error: 'cnt' undeclared (first use in this function); did you mean 'int'? 6 | cnt =0; | ^~~ | int main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
s519648466
p00014
C
#include<stdio.h> int main(void) { int i,j,area=0; for(i=0;i<20;i++) { scanf("%d\n",&d); for(j=1;j<=600-d;j++) area+=d^3*j^2; printf("%d\n",area); } return 0; }
main.c: In function 'main': main.c:8:15: error: 'd' undeclared (first use in this function) 8 | scanf("%d\n",&d); | ^ main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
s214807500
p00014
C
#include<stdio.h> int main() { int d, s, i, sum; while(scanf("%d", &d)!=EOF){ sum = 0; for(i*d=0; i*d<=600-d; i++){ s = d*(i*d)*(i*d); sum = sum + s; } printf("%d\n", sum); } return 0; }
main.c: In function 'main': main.c:11:14: error: lvalue required as left operand of assignment 11 | for(i*d=0; i*d<=600-d; i++){ | ^
s696995682
p00014
C
#include <stdio.h> int area(int x,int d); int main(void) { int x, s, d, i, j; for (;;) { scanf_s("%d", &d); x = 600 / d; s = 0; for (j = 1; j < x; j++) { s += area(j,d); } printf("%d\n", s); } return 0; } int area(int x,int d) { return d*(x*d)*(x*d); }
main.c: In function 'main': main.c:7:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scanf_s("%d", &d); | ^~~~~~~ | scanf
s642351869
p00014
C
#inclde<stdio.h> int main(void) { int d,i,d2; scanf("%d",&d); d2=d*d; for(i=0;i<=d;i++){ s=d*(i*i); s+=s; } printf("%d",s)
main.c:1:2: error: invalid preprocessing directive #inclde; did you mean #include? 1 | #inclde<stdio.h> | ^~~~~~ | include main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d",&d); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inclde<stdio.h> main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d",&d); | ^~~~~ main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:9:4: error: 's' undeclared (first use in this function) 9 | s=d*(i*i); | ^ main.c:9:4: note: each undeclared identifier is reported only once for each function it appears in main.c:12:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | printf("%d",s) | ^~~~~~ main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:17: error: expected ';' at end of input 12 | printf("%d",s) | ^ | ; 13 | main.c:12:3: error: expected declaration or statement at end of input 12 | printf("%d",s) | ^~~~~~
s687440948
p00014
C
#inclde<stdio.h> int main(void) { int d,i,d2; scanf("%d",&d); d2=d*d; for(i=0;i<=d;i++){ s=d*(i*i); s+=s; } printf("%d",s); return 0; }
main.c:1:2: error: invalid preprocessing directive #inclde; did you mean #include? 1 | #inclde<stdio.h> | ^~~~~~ | include main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d",&d); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inclde<stdio.h> main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d",&d); | ^~~~~ main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:9:4: error: 's' undeclared (first use in this function) 9 | s=d*(i*i); | ^ main.c:9:4: note: each undeclared identifier is reported only once for each function it appears in main.c:12:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 12 | printf("%d",s); | ^~~~~~ main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:12:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf'
s423808023
p00014
C
#inclde<stdio.h> int main(void) { int d,i; scanf("%d",&d); for(i=0;i<=d;i++) { s=d*(i*i); s+=s; } printf("%d",s); return 0; }
main.c:1:2: error: invalid preprocessing directive #inclde; did you mean #include? 1 | #inclde<stdio.h> | ^~~~~~ | include main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d",&d); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inclde<stdio.h> main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d",&d); | ^~~~~ main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:10:4: error: 's' undeclared (first use in this function) 10 | s=d*(i*i); | ^ main.c:10:4: note: each undeclared identifier is reported only once for each function it appears in main.c:13:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | printf("%d",s); | ^~~~~~ main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
s862194436
p00014
C
#inclde<stdio.h> int main(void) { int d,i,s,a; scanf("%d",&d); for(i=0;i<=d;i++) { s=d*(i*i); a+=s; } printf("%d",a); return 0; }
main.c:1:2: error: invalid preprocessing directive #inclde; did you mean #include? 1 | #inclde<stdio.h> | ^~~~~~ | include main.c: In function 'main': main.c:6:2: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d",&d); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inclde<stdio.h> main.c:6:2: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d",&d); | ^~~~~ main.c:6:2: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | printf("%d",a); | ^~~~~~ main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'printf'