submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s159348081
p02263
C++
#include<iostream> #include<stack> using namespace std; #define scanf scanf_s int main() { int i, j, a, b; char c[1000000]; stack<int> s; while (scanf("%s", c) != EOF) { if (c[0] == '+') { b = s.top(); s.pop(); a = s.top(); s.pop(); s.push(a + b); } else if (c[0] == '-') { b = s.top(); s.p...
a.cc: In function 'int main()': a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 4 | #define scanf scanf_s | ^~~~~~~ a.cc:10:16: note: in expansion of macro 'scanf' 10 | while (scanf("%s", c) != EOF) { | ^~~~~
s574739690
p02263
C++
#include<iostream> #include<stack> using namespace std; #define scanf scanf_s int main() { int i, j, a, b; char c[1000000]; stack<int> s; while (scanf("%s", c) != EOF) { if (c[0] == '+') { b = s.top(); s.pop(); a = s.top(); s.pop(); s.push(a + b); } else if (c[0] == '-') { b = s.top(); s.p...
a.cc: In function 'int main()': a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 4 | #define scanf scanf_s | ^~~~~~~ a.cc:10:16: note: in expansion of macro 'scanf' 10 | while (scanf("%s", c) != EOF) { | ^~~~~
s795451918
p02263
C++
#include <iostream> #include <string> using namespace std; int main(){ long a, b; long top = 0; char c[200]; long s[200]; for (long i = 0; i < 200; i++){ while (cin >> c[i]){ if (c[i] == '+'){ a = s[top]; top--; b = s[top]; s[top] = a + b; } else if (c[i] == '-'){ b = s[top]; t...
a.cc: In function 'int main()': a.cc:33:50: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 33 | s[top] = atoi(c[i]); | ~~~^ | | | ...
s423364938
p02263
C++
#include <iostream> #include <string> #include <cstdlib> using namespace std; int main(){ long a, b; long top = 0; char c[200]; long s[200]; for (long i = 0; i < 200; i++){ while (cin >> c[i]){ if (c[i] == '+'){ a = s[top]; top--; b = s[top]; s[top] = a + b; } else if (c[i] == '-'){ ...
a.cc: In function 'int main()': a.cc:34:50: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 34 | s[top] = atoi(c[i]); | ~~~^ | | | ...
s546127890
p02263
C++
#include <iostream> #include <string> #include <cstdlib> #include <sstream> using namespace std; int main(){ long a, b; long top = 0; char c[200]; long s[200]; for (long i = 0; i < 200; i++){ while (cin >> c[i]){ if (c[i] == '+'){ a = s[top]; top--; b = s[top]; s[top] = a + b; } else i...
a.cc: In function 'int main()': a.cc:35:52: error: request for member 'c_str' in 'c[i]', which is of non-class type 'char' 35 | s[top] = atoi(c[i].c_str()); | ^~~~~
s088707209
p02263
C++
#include <iostream> #include <string> #include <cstdlib> #include <sstream> using namespace std; int main(){ long a, b; long top = 0; string c(200, '0'); long s[200]; for (long i = 0; i < 200; i++){ while (cin >> c[i]){ if (c[i] == '+'){ a = s[top]; top--; b = s[top]; s[top] = a + b; } ...
a.cc: In function 'int main()': a.cc:35:52: error: request for member 'c_str' in 'c.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 35 | ...
s635824642
p02263
C++
#include <iostream> #include <string> #include <cstdlib> #include <sstream> using namespace std; int main(){ long a, b; long top = 0; string c(200, '0'); long s[200]; for (long i = 0; i < 200; i++){ while (cin >> c[i]){ if (c[i] == '+'){ a = s[top]; top--; b = s[top]; s[top] = a + b; } ...
a.cc: In function 'int main()': a.cc:36:47: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 36 | s[top] = atoi(ch); | ^~ | | | ...
s569880484
p02263
C++
#include <iostream> #include <string> #include <cstdlib> #include <sstream> using namespace std; int main(){ long a, b; long top = 0; string c(200, '0'); long s[200]; for (long i = 0; i < 200; i++){ while (cin >> c[i]){ if (c[i] == '+'){ a = s[top]; top--; b = s[top]; s[top] = a + b; } ...
a.cc: In function 'int main()': a.cc:35:53: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive] 35 | const char* ch = c[i]; | ^ |...
s954778990
p02263
C++
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; class Siki { int stack[100]; //???????????? int num; //????´???° public: Siki() { num = 0; } void push( int val ) { if (num >= 100) { cout << "overflow" << endl; return; } stack[num] = val; num++; } int po...
a.cc: In function 'int main()': a.cc:55:9: error: 'gets_s' was not declared in this scope 55 | gets_s(input); | ^~~~~~ a.cc:60:16: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 60 | while (sscanf_s(input, "%s", in, sizeof(in) ) == 1) { | ...
s382329329
p02263
C++
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; class Siki { int stack[100]; //???????????? int num; //????´???° public: Siki() { num = 0; } void push( int val ) { if (num >= 100) { cout << "overflow" << endl; return; } stack[num] = val; num++; } int po...
a.cc: In function 'int main()': a.cc:55:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 55 | gets(input); | ^~~~ | getw
s743386274
p02263
C++
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; class Siki { int stack[100]; //???????????? int num; //????´???° public: Siki() { num = 0; } void push( int val ) { if (num >= 100) { cout << "overflow" << endl; return; } stack[num] = val; ...
a.cc: In function 'int main()': a.cc:56:9: error: 'gets_s' was not declared in this scope 56 | gets_s(input); | ^~~~~~ a.cc:61:16: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 61 | while (sscanf_s(input, "%s", in, sizeof(in) ) == 1) { | ...
s540288158
p02263
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 #include <stdio.h> #include <stdlib.h> #include <string.h> int top,S[1000]; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top+1]; } int main(){ int a,b; t...
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 1 | ^ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/stdlib.h:36, from a.cc:46: /usr/include/stdlib.h:98:8: error: 'size_t' does not name a type 98 | extern size_t __ctype_...
s129363192
p02263
C++
#include <stdio.h> int main(){ int top,stack[100]; char input[8]; top = 0; while( scanf("%s",input) != EOF ){ if( '+' == input[0] ){ top--; stack[top] += stack[top+1]; } else if( '-' == input[0] ){ top--; stack[top] -= stack[top+1]; } else if( '*' == input[0] ){ ...
a.cc: In function 'int main()': a.cc:22:20: error: 'atoi' was not declared in this scope 22 | stack[top] = atoi(input); | ^~~~
s340970807
p02263
C++
include <stdio.h> #include <stdlib.h> #include <string.h> int top,P[1000000]; void push(int y) { P[++top] = y; } int pop() { top--; return P[top+1]; } int main() { int a,b,c; char x[100]; top=0; while(1) { if(scanf("%s",&x[0]) == EOF) break; if(x[0] == '+'){ a=pop(); b=pop(); ...
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:23:8: error: 'scanf' was not declared in this scope 23 | if(scanf("%s",&x[0]) == EOF) break; | ^~~~~ a.cc:23:29: error: 'EOF' was not declared in this scope 23 | if(s...
s654832369
p02263
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> void push(int); int pop(void); int instack[200],stacknum=0; int main(){ int op2; char s[200]; while(scanf("%s ",s)!=EOF){ #include<stdio.h> #include<stdlib.h> #include<string.h> void push(int); int pop(void); int instack[200],stacknum=0; int main(){ ...
a.cc: In function 'int main()': a.cc:24:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 24 | int main(){ | ^~ a.cc:24:9: note: remove parentheses to default-initialize a variable 24 | int main(){ | ^~ | -- a.cc:24:9: note: or re...
s192361739
p02263
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 1000 void push(int); int pop(void); int Stack[MAX]; int top=0; int main(){ int a,b; top = 0; char stack[100]; while(scanf("%s",stack)!=EOF){ if(stack[0]=='+'){ a = pop(); b = pop(); push(a+b); } else if(s...
a.cc: In function 'int pop()': a.cc:52:23: error: expected '}' at end of input 52 | return Stack[top+1]; | ^ a.cc:50:10: note: to match this '{' 50 | int pop(){ | ^
s045341468
p02263
C++
#include <iostream> #include <fstream> #include <queue> #include <string> #include <sstream> using namespace std; int stoi (string str) { stringstream ss (str); int n; ss >> n; return n; } int main() { //ifstream fin("in.txt"); queue<int> temp; queue<int> main; char s[16]; while(!cin.eof()) { ci...
a.cc: In function 'int main()': a.cc:32:20: error: 'strcmp' was not declared in this scope 32 | if(strcmp(s,"+") == 0) { | ^~~~~~ a.cc:9:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <sstream> ++...
s674148739
p02263
C++
//逆ポーランド記法 #include<stdio.h> #include<string.h> #define STACK_SIZE 100 #define TRUE 1 #define FALSE 0 #define N 300 int stack[STACK_SIZE]; int top=0; int isEmpty(){ if(stack[top]==0){ return TRUE; }else{ return FALSE; } } void push(int a){ top++; stack[top]=a; } int pop(){ if(isEmpty()=...
a.cc: In function 'int main()': a.cc:53:15: error: 'atoi' was not declared in this scope 53 | num=atoi(str); | ^~~~ a.cc: In function 'int pop()': a.cc:32:1: warning: control reaches end of non-void function [-Wreturn-type] 32 | } | ^
s157697170
p02263
C++
#include<iostream> #include<stack> #include<stdio.h> #include<stdlib.h> using namespace std; int main(){ stack<int> intStack; char c; while(scanf("%c",&c)){ if(c=='+'||c=='-'||c=='*'){ int in,a,b; b=intStack.top(); intStack.pop(); a=intStack.top(); intStack.pop(); switch (c){ case '+': ...
a.cc: In function 'int main()': a.cc:28:32: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 28 | a=atoi(c); | ^ | | | char In file included from /usr/include/c+...
s604258630
p02263
C++
#include <iostream> #include <stack> using namespace std; int cul( m1, m2, m0 ) { int ret; if ( m0 == '+' ) ret = m1 + m2; if ( m0 == '-' ) ret = m1 - m2; if ( m0 == '*' ) ret = m1 * m2; return ret; } int main() { stack<int> s; int m0, m1, m2; for ( int i = 0; i < 99; i++ ) { while (1) { cin >> m0; if...
a.cc:5:10: error: 'm1' was not declared in this scope 5 | int cul( m1, m2, m0 ) { | ^~ a.cc:5:14: error: 'm2' was not declared in this scope 5 | int cul( m1, m2, m0 ) { | ^~ a.cc:5:18: error: 'm0' was not declared in this scope 5 | int cul( m1, m2, m0 ) { | ...
s013605036
p02263
C++
#include <iostream> #include <stack> using namespace std; int cul( n1, n2, n0 ) { int ret; if ( n0 == '+' ) ret = n1 + n2; if ( n0 == '-' ) ret = n1 - n2; if ( n0 == '*' ) ret = n1 * n2; return ret; } int main() { stack<int> s; int m0, m1, m2; for ( int i = 0; i < 99; i++ ) { while (1) { cin >> m0; if...
a.cc:5:10: error: 'n1' was not declared in this scope 5 | int cul( n1, n2, n0 ) { | ^~ a.cc:5:14: error: 'n2' was not declared in this scope 5 | int cul( n1, n2, n0 ) { | ^~ a.cc:5:18: error: 'n0' was not declared in this scope 5 | int cul( n1, n2, n0 ) { | ...
s707437958
p02263
C++
#include <iostream> #include <stack> #include <string>; using namespace std; int cul( int n1, int n2, string ss ) { int ret; if ( ss == "+" ) ret = n1 + n2; if ( ss == "-" ) ret = n1 - n2; if ( ss == "*" ) ret = n1 * n2; return ret; } int main() { stack<int> s; string st; int m1, m2; while ( cin >> st ) { ...
a.cc:3:18: warning: extra tokens at end of #include directive 3 | #include <string>; | ^ a.cc: In function 'int main()': a.cc:26:33: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int' 26 | s.push( (int)st ); | ...
s943044584
p02263
C++
//?????????????????????????????????????????? //?????????????????¨????????????????§??????? //?????????????????????????????????????????? #include<iostream> #include<string> #include<stack> using namespace std; /* //????????????????????? class IntStack{ public: int top; string str; //????????? initialize(){ to...
a.cc: In function 'int main(int, char**)': a.cc:53:9: error: parse error in template argument list 53 | getline <std> str; | ^~~~~~~~~~~~~ a.cc:53:22: error: expected ';' before 'str' 53 | getline <std> str; | ^~~~ | ; a.cc:53:9: ...
s282902862
p02263
C++
/*** * ??´??°??????????????????????????????????????¢??????????????????????????? ****/ //??????????????????????????¢?????? //#ifndef INTSTACH_H #define INTSTACK_H #include <iostream> #include <stdlib.h> using namespace std; //------------------------------------------------------- // ????????????????????? class IntS...
a.cc:44:17: error: expected unqualified-id before 'if' 44 | if( sp >= size){ | ^~ a.cc:49:24: error: expected ')' before '+' token 49 | *(stack + sp) = value ;//value??????????????????????????????????????£??\(?) | ~ ^~ | ...
s278335802
p02263
C++
#include <cstdio> #include <iostream> #include <algorithm> #include <cstdlib> #include <cmath> #include <vector> #include <ctime> #include <stack> #include <string> using namespace std; int main(void){ string word; stack<int> S; while(cin >> word){ if(word == "+"){ int a, b; a = S.top; S.pop; b = S....
a.cc: In function 'int main()': a.cc:20:31: error: cannot resolve overloaded function 'top' based on conversion to type 'int' 20 | a = S.top; | ^~~ a.cc:21:27: error: invalid use of non-static member function 'void std::stack<_Tp, _Sequence>::pop() [with _T...
s266906870
p02263
C++
#include <cstdio> #include <iostream> #include <algorithm> #include <cstdlib> #include <cmath> #include <vector> #include <ctime> #include <stack> #include <string> using namespace std; int main(void){ string word; stack<int> S; while(cin >> word){ if(word == "+"){ int a, b; a = S.top(); S.pop(); b...
a.cc: In function 'int main()': a.cc:41:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 41 | S.push(atoi(word)); | ^~~~ | | | ...
s527657996
p02263
C++
#include<bits/stdc++.h> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop(){ top--; return S[top+1]; } int main(){ int a,b; top =0; char s[100]; while(cin>>s != EOF){ if(s[0]=='+'){ a = pop(); b = pop(); push(a+b); }else if(s[0]=='-'){ a = pop(); b = pop(); push(a-b); }else if (s[0]=='*'){ a...
a.cc: In function 'int main()': a.cc:15:14: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'int') 15 | while(cin>>s != EOF){ | ~~~~~~ ^~ | | | std::basic_istream<char> a.cc:15:14: note: candidate: 'operator!=(int, int)' (built-in) 15 | ...
s242993556
p02263
C++
#include<bits/stdc++.h> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop(){ top--; return S[top+1]; } int main(){ int a,b; top =0; char s[100]; while(cin>>s != EOF){ if(s[0]=='+'){ a = pop(); b = pop(); push(a+b); }else if(s[0]=='-'){ a = pop(); b = pop(); push(a-b); }else if (s[0]=='*'){ a...
a.cc: In function 'int main()': a.cc:15:14: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'int') 15 | while(cin>>s != EOF){ | ~~~~~~ ^~ | | | std::basic_istream<char> a.cc:15:14: note: candidate: 'operator!=(int, int)' (built-in) 15 | ...
s004925312
p02263
C++
#include <iostream> #include <stack> #include <string> #include <cstdlib> using namespace std; int main() { stack<int> st; int a, b; string s; while (cin >> s) { if (s[0] == '+') { b = st.top(); st.pop(); a = st.top(); st.pop(); st.push(a + b); } else if (s[0] == '-') { b = st.top(); st.pop(); ...
a.cc: In function 'int main()': a.cc:33:1: error: expected primary-expression before '?' token 33 | ????????????cout << st.top() << endl; | ^ a.cc:33:2: error: expected primary-expression before '?' token 33 | ????????????cout << st.top() << endl; | ^ a.cc:33:3: error: expected primary-expression bef...
s383594874
p02263
C++
#include <string> #include <stdio.h> #include <math.h> #include <iostream> using namespace std; #define N 1000 void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); int S[N], top = 0; int main(void) { char op[13], str[2400] = {'\0'}; int x,a, b, cou = 0; gets_s(str, s...
a.cc: In function 'int main()': a.cc:17:9: error: 'gets_s' was not declared in this scope 17 | gets_s(str, sizeof(str) - 1); | ^~~~~~ a.cc:29:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 29 | default: sscanf_s(op, "%d", &x); push(x); ...
s816176462
p02263
C++
#include <string> #include <stdio.h> #include <math.h> #include <iostream> using namespace std; #define N 1000 void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); int S[N], top = 0; int main(void) { char op[13], str[2400] = {'\0'}; int x,a, b, cou = 0; gets(str); f...
a.cc: In function 'int main()': a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(str); | ^~~~ | getw a.cc:29:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 29 | default: sscanf_s(op, "%...
s025819124
p02263
C++
#include <string> #include <stdio.h> #include <math.h> #include <iostream> using namespace std; #define N 1000 void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); int S[N], top = 0; int main(void) { char op[13], str[2400] = {'\0'}; int x,a, b, cou = 0; gets_s(str, s...
a.cc: In function 'int main()': a.cc:17:9: error: 'gets_s' was not declared in this scope 17 | gets_s(str, sizeof(str) - 1); | ^~~~~~ a.cc:29:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 29 | default: sscanf_s(op, "%d", &x); push(x); ...
s588914693
p02263
C++
#include <string> #include <stdio.h> #include <math.h> #include <iostream> using namespace std; #define N 1000 void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); int S[N], top = 0; int main(void) { char op[13], str[2400] = {'\0'}; int x,a, b, cou = 0; gets(str); f...
a.cc: In function 'int main()': a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(str); | ^~~~ | getw a.cc: In function 'int pop()': a.cc:49:1: warning: control reaches end of non-void function [-Wreturn-type] 49 | } | ^
s896368308
p02263
C++
#include <stdio.h> #include <string> #include <math.h> #include <iostream> using namespace std; #define N 1000 void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); int S[N], top = 0; int main(void) { char op[13], str[2400] = {'\0'}; int x,a, b, cou = 0; gets_s(str, s...
a.cc: In function 'int main()': a.cc:17:9: error: 'gets_s' was not declared in this scope 17 | gets_s(str, sizeof(str) - 1); | ^~~~~~ a.cc:29:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 29 | default: sscanf_s(op, "%d", &x); push(x); ...
s844730043
p02263
C++
#include <stdio.h> #include <string> #include <math.h> #include <iostream> using namespace std; #define N 1000 void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); int S[N], top = 0; int main(void) { char op[13]; int x,a, b, cou = 0; while(scanf("%s",op) != EOF){ s...
a.cc: In function 'int main()': a.cc:23:34: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 23 | default: sscanf_s(op, "%d", &x); push(x); | ^~~~~~~~ | sscanf a.cc: In function 'int pop()': ...
s823047541
p02263
C++
#include <stdio.h> #include <string> #include <math.h> #include <iostream> using namespace std; void push(int x); // int pop(void); // int isEmpty(void); // int isFull(void); void initialize(void); static int S[N], top = 0; int main(void) { char op[13]; int x,a, b, cou = 0; while(scanf("%s",op) != EOF){ switch (o...
a.cc:11:14: error: 'N' was not declared in this scope 11 | static int S[N], top = 0; | ^ a.cc: In function 'void push(int)': a.cc:31:17: error: 'S' was not declared in this scope 31 | S[top] = x; | ^ a.cc: In function 'int pop()': a.cc:38:25: error: 'S' was...
s899484228
p02263
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cmath> #include <stack> #include <stdlib> using namespace std; #define REP(i,n) for(int (i)=0; (i)<(n); (i)++) #define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++) int main() { stack<long> st; string s; while (cin >> s) ...
a.cc:7:10: fatal error: stdlib: No such file or directory 7 | #include <stdlib> | ^~~~~~~~ compilation terminated.
s710231025
p02263
C++
??¨
a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??¨ | ^
s995034940
p02263
C++
main(){ int op1,op2; int pmb; scanf("%d",&op1); while(scanf("%d",&op2)!=EOF){ pmb = getchar(); switch(pmb){ case '+': op1+=op2; break; case '-': op1-=op2; break; case '*': op1*=op2; break; } } printf("%d\n",op1); }
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:4:3: error: 'scanf' was not declared in this scope 4 | scanf("%d",&op1); | ^~~~~ a.cc:5:27: error: 'EOF' was not declared in this scope 5 | while(sc...
s404562699
p02263
C++
#inlude<stdio.h> main(){ char op[10000000000]; int memory[100]; int cnt = 0,num; while(scanf("%s",op)!=EOF){ if(op=="+"){ memory[cnt-1] += memory[cnt]; cnt--; }else if(op=="-"){ memory[cnt-1] -= memory[cnt]; cnt--; }else if(op=="*"){ memory[cnt-1] *= memory[cnt]; ...
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include? 1 | #inlude<stdio.h> | ^~~~~~ | include a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'scanf' was not d...
s333974299
p02263
C++
#include<stdio.h> #include<stdlib.h> main(){ char op[1000200]; int memory[100],cnt=0; while(scanf(%s,op)!=EOF){ if(op=="+"){ memory[cnt-2]+=memory[cnt-1]; cnt--; }else if(op=="-"){ memory[cnt-2]-=memory[cnt-1]; cnt--; }else if(op=="*"){ memory[cnt-2]*=memory[cnt-1]; ...
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:15: error: expected primary-expression before '%' token 6 | while(scanf(%s,op)!=EOF){ | ^ a.cc:6:16: error: 's' was not declared in this sco...
s742062463
p02263
C++
#include<stdio.h> #include<stdlib.h> main(){ char op[1000200]; int memory[100],cnt=0; while(scanf("%s",op)!=EOF){ if(op=="+")||(op=="+\n"){ memory[cnt-2]+=memory[cnt-1]; cnt--; }else if(op=="-"){ memory[cnt-2]-=memory[cnt-1]; cnt--; }else if(op=="*"){ memory[cnt-2]*=memor...
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:7:16: error: expected primary-expression before '||' token 7 | if(op=="+")||(op=="+\n"){ | ^~
s188187862
p02263
C++
#include<iostream> #include <cstdio> #include <algorithm> using namespace std; int top, S[1000]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a,b; top = 0; char s[100]; while (scanf_s("%s",s) != EOF) { if (s[0] == '+') { a = pop(); b = pop(); push(...
a.cc: In function 'int main()': a.cc:23:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 23 | while (scanf_s("%s",s) != EOF) | ^~~~~~~ | scanf
s722891763
p02263
C++
#include<iostream> #include<stack> using namespace std; int main(){ stack<int> st; char c; while(cin >> c){ if( isdigit(c) != 0 ){ //??°?????§????????° int x = (int)(c - '0'); //char -> int st.push(x); }else{ //???????????§????????° int y = st.top(); st.pop(); int z = st.pop(); st.pop(); swi...
a.cc: In function 'int main()': a.cc:14:39: error: void value not ignored as it ought to be 14 | int z = st.pop(); | ~~~~~~^~ a.cc:24:55: error: expected ';' before ':' token 24 | st.push(z * y): | ...
s190932530
p02263
C++
#include<bits/stdc++.h> using namespace std; int main(){ stack<int> st; char c; while( cin >> c ){ if( isdigit(c) != 0 ){ //??°?????§????????° st.push( atoi(c) ); }else{ //???????????§????????° int y = st.top(); st.pop(); int z = st.top(); st.pop(); switch(c){ case('+'): st.push(z + y); break; ...
a.cc: In function 'int main()': a.cc:8:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 8 | st.push( atoi(c) ); | ^ | | | char In file ...
s777956232
p02263
C++
#include<bits/stdc++.h> using namespace std; stack<int> st; int main(){ char c; while( cin >> c ){ if( isdigit(c) != 0 ){ st.push( atoi(c) ); }else{ int y = st.top(); st.pop(); int z = st.top(); st.pop(); switch(c){ case('+'): st.push(z + y); break; case('-'): st.push(z - y); break; case('...
a.cc: In function 'int main()': a.cc:8:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 8 | st.push( atoi(c) ); | ^ | | | char In file ...
s280335123
p02263
C++
#include<iostream> #include<stack> #include<cstdlib> using namespace std; stack<int> st; int main(){ char c; while( cin >> c ){ if( isdigit(c) != 0 ){ st.push( atoi(c) ); }else{ int y = st.top(); st.pop(); int z = st.top(); st.pop(); switch(c){ case('+'): st.push(z + y); break; case('-'): st.p...
a.cc: In function 'int main()': a.cc:10:39: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 10 | st.push( atoi(c) ); | ^ | | | char In file...
s347246398
p02263
C++
#include<iostream> #include<stack> #include<cstdlib> using namespace std; stack<int> s; int main(){ int x, y; char c; while( cin >> c ){ if ( c == '+' ){ x = s.top(); s.pop(); y = s.top(); s.pop(); s.push(a+b); } else if( c == '-' ){ x = s.top(); s.pop(); y = s.top(); s.pop(); s.push(b-a); ...
a.cc: In function 'int main()': a.cc:13:32: error: 'a' was not declared in this scope 13 | s.push(a+b); | ^ a.cc:13:34: error: 'b' was not declared in this scope 13 | s.push(a+b); | ^ a.cc:1...
s670174959
p02263
C++
#include<iostream> #include<stack> #include<cstdlib> using namespace std; stack<int> s; int main(){ int x, y; char c; while( cin >> c ){ if ( c == '+' ){ x = s.top(); s.pop(); y = s.top(); s.pop(); s.push(x+y); } else if( c == '-' ){ x = s.top(); s.pop(); y = s.top(); s.pop(); s.push(y-x); ...
a.cc: In function 'int main()': a.cc:25:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 25 | x = atoi(c); | ^ | | | char In file included from /usr/in...
s344541516
p02263
C++
#include<iostream> #include<stack> #include<string> #include<cstdlib> using namespace std; stack<int> s; int main(){ int x, y; string c; while( cin >> c ){ if ( c == '+' ){ x = s.top(); s.pop(); y = s.top(); s.pop(); s.push( x + y ); } else if( c == '-' ){ x = s.top(); s.pop(); y = s.top(); s.po...
a.cc: In function 'int main()': a.cc:11:24: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 11 | if ( c == '+' ){ | ~ ^~ ~~~ | | | | | char ...
s609204857
p02263
C++
#include<iostream> #include<stack> #include<string> #include<cstdlib> using namespace std; stack<int> s; int main(){ int x, y; string c; while( cin >> c ){ if ( c == "+" ){ x = s.top(); s.pop(); y = s.top(); s.pop(); s.push( x + y ); } else if( c == "-" ){ x = s.top(); s.pop(); y = s.top(); s.po...
a.cc: In function 'int main()': a.cc:26:35: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 26 | x = atoi( c ); | ^ | | | std::...
s097607601
p02263
C++
#include<iostream> #include<stack> #include<cstdlib> #include<string> using namespace std; int main(){ stack<int> st; string s; int a, b, num; while ( cin >> s ){ if( s == "+" ){ a = st.top(); st.pop(); b = st.top(); st.pop(); st.push(a + b); } else if( s == "-" ){ a = st.top(); st.pop(); b ...
a.cc: In function 'int main()': a.cc:29:48: error: expected ';' before ':' token 29 | num = atoi( s.c_str() ): | ^ | ; a.cc:33:2: error: expected '}' at end of input 33 | } | ^ ...
s514789950
p02263
C++
#include<iostream> #include<stack> #include<cstdlib> #include<string> using namespace std; int main(){ stack<int> st; string s; int a, b, num; while ( cin >> s ){ if( s == "+" ){ a = st.top(); st.pop(); b = st.top(); st.pop(); st.push(a + b); } else if( s == "-" ){ a = st.top(); st.pop(); b ...
a.cc: In function 'int main()': a.cc:33:2: error: expected '}' at end of input 33 | } | ^ a.cc:7:11: note: to match this '{' 7 | int main(){ | ^
s864315224
p02263
C++
#include <iostream> #include <stack> #include <cstdlib> using namespace std; int main(){ stack<int> t; string s; int a,b,c; while(cin>>s){ if('0'<=s[0]&&s[0]<='9'){ t.push(atoi(s)); } else t.push(s[0]-'0'); } else if(s=="+"){ a=t.top();t.pop(); b=t.top();t.pop(); ...
a.cc: In function 'int main()': a.cc:12:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 12 | t.push(atoi(s)); | ^ | | | std::string {aka std::__cxx11::basic_string<char>} In file included f...
s524914822
p02263
C++
#include<stdio.h> #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop{ top --; return S[top+1]; } int main(){ int v; while (scanf("%s", &n) != EOF){ if (n[0] == "+"){ v=pop() + pop(); push(v...
a.cc:15:8: error: expected '}' before ';' token 15 | top --; | ^ a.cc:14:8: note: to match this '{' 14 | int pop{ | ^ a.cc:16:2: error: expected unqualified-id before 'return' 16 | return S[top+1]; | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } ...
s616918823
p02263
C++
#include<stdio.h> #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop{ top--; return S[top+1]; } int main(){ int v; while (scanf("%s", &n) != EOF){ if (n[0] == "+"){ v=pop() + pop(); push(v)...
a.cc:15:7: error: expected '}' before ';' token 15 | top--; | ^ a.cc:14:8: note: to match this '{' 14 | int pop{ | ^ a.cc:16:2: error: expected unqualified-id before 'return' 16 | return S[top+1]; | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } ...
s625578010
p02263
C++
#include<stdio.h> #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop(){ top--; return S[top+1]; } int main(){ int v; while (scanf("%s", &n) != EOF){ if (n[0] == "+"){ v=pop() + pop(); push(...
a.cc: In function 'int main()': a.cc:21:21: error: 'n' was not declared in this scope 21 | while (scanf("%s", &n) != EOF){ | ^
s288560382
p02263
C++
#include<stdio.h> #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop(){ top--; return S[top+1]; } int main(){ int v; char n[100]; while (scanf("%s", &n) != EOF){ if (n[0] == "+"){ v=pop() + po...
a.cc: In function 'int main()': a.cc:23:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 23 | if (n[0] == "+"){ | ~~~~~^~~~~~ a.cc:26:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 26 | }else if (n[0] == "-"){ | ~~...
s597263664
p02263
C++
#include<stdio.h> #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> using namespace std; int top,S[1000]; void push(int x){ S[++top]=x; } int pop(){ top--; return S[top+1]; } int main(){ int v; char n[100]; while (scanf("%s", n) != EOF){ if (n[0] == "+"){ v=pop() + pop...
a.cc: In function 'int main()': a.cc:23:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 23 | if (n[0] == "+"){ | ~~~~~^~~~~~ a.cc:26:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 26 | }else if (n[0] == "-"){ | ~~...
s923795914
p02263
C++
#include <string> #include <stack> #include <iostream> using namespace std; int main(){ string word; stack<int> S; while(cin >> word){ if(word == "+"){ int x = S.pop(), y = S.pop(); S.push(y - x); } else if(word == "-"){ int x = S.pop(), y = S.pop...
a.cc: In function 'int main()': a.cc:11:26: error: void value not ignored as it ought to be 11 | int x = S.pop(), y = S.pop(); | ~~~~~^~ a.cc:11:39: error: void value not ignored as it ought to be 11 | int x = S.pop(), y = S.pop(); | ...
s963582218
p02263
C++
#include <string> #include <stack> #include <stdio> #include <iostream> using namespace std; int main(){ string word; stack<int> S; while(cin >> word){ if(word == "+"){ int x = S.top(); S.pop(); int y = S.top(); S.pop(); S.push(y + x); ...
a.cc:3:10: fatal error: stdio: No such file or directory 3 | #include <stdio> | ^~~~~~~ compilation terminated.
s287936642
p02263
C++
#include <string> #include <stack> #include <stdio.h> #include <iostream> using namespace std; int main(){ string word; stack<int> S; while(cin >> word){ if(word == "+"){ int x = S.top(); S.pop(); int y = S.top(); S.pop(); S.push(y + x); ...
a.cc: In function 'int main()': a.cc:34:20: error: 'str' was not declared in this scope; did you mean 'std'? 34 | sscanf(str.c_str(), "%d", &i); | ^~~ | std
s869677754
p02263
C++
#include<string> #include<stack> #include<iostream> #include<stdlib.c> using namespace std; int main(){ string word; stack<int>S; int n,n1,n2,p; while(cin>>word){ if(word=="+"){ n1=S.top(); S.pop(); n2=S.top(); S.pop(); n=n1+n2; ...
a.cc:5:9: fatal error: stdlib.c: No such file or directory 5 | #include<stdlib.c> | ^~~~~~~~~~ compilation terminated.
s285090894
p02263
C++
#include <cstdio> using namespace std; int top, S[1000]; void push(int x) { S[++top] = x; } int pop() { --top; return S[top + 1]; } int main() { int a, b; top = 0; char s[100]; while (scanf("%s", s) != EOF) { if (s[0] == '+') { a = pop(); b = pop(); push(a + b); } else if (s[...
a.cc: In function 'int main()': a.cc:33:12: error: 'atoi' was not declared in this scope 33 | push(atoi(s)); | ^~~~
s800133508
p02263
C++
#include <iostream> #include <string> #include <stdlib.h> using namespace std; class stack { public: int s[100]; int t; public: void initialize(); void push(int x); int pop(); }; void stack::initialize() { t = 0; } void stack::push(int x) { s[t] = x; t++; } int stack::pop() { t--; return s[t]; } int...
a.cc: In function 'int main()': a.cc:77:17: error: expected '}' before 'else' 77 | else | ^~~~ a.cc:69:17: note: to match this '{' 69 | { | ^
s610555967
p02263
C++
#include <bits\stdc++.h> #define _CRT_ using namespace std; int main() { stack<int> S; string s; while (cin >> s) { //printf("input:%s.", s.c_str()); if (s == "+") { //printf("i got +.\n"); int right = S.top(); S.pop(); int left = S.top(); S.pop(); S.push(right + left); continue; } if (s =...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s723981319
p02263
C++
#include <iostream> using namespace std; int main(){ string s; int n=0,a[50]; getline(cin, s); s[1]=s[2]; for(int i=2;i<(s.size()+1)/2;i++){ s[i]=s[i*2]; if(0<=s[i-1]-'0'&&s[i-1]-'0'<=9){ int x=s[i-2]-'0',y=s[i-1]-'0'; if(s[i]=='+')a[n]=x+y,n++; i...
a.cc: In function 'int main()': a.cc:15:39: error: expected '}' at end of input 15 | if(s[i]=='*')a[n]=x*y,n++; | ^ a.cc:11:41: note: to match this '{' 11 | if(0<=s[i-1]-'0'&&s[i-1]-'0'<=9){ | ^ a.cc:15:3...
s103546973
p02263
C++
hdh
a.cc:1:1: error: 'hdh' does not name a type 1 | hdh | ^~~
s000589672
p02263
C++
#include<bits/stdc++.h> using namespace std; int main() { stack<int> si; char str[10010]; gets(str); for(int i=0;i<strlen(str);i++) { //printf("%d\n",i); if(isdigit(str[i])) { int t; sscanf(&str[i],"%d",&t); si.push(t); while(isdigit(str[i])) i++; } else if(str[i]=='+') { int s1=si.top...
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(str); | ^~~~ | getw
s236615412
p02263
C++
#include<bits/stdc++.h> using namespace std; int main() { stack<int> si; char str[10010]; gets(str); for(int i=0;i<strlen(str);i++) { //printf("%d\n",i); if(isdigit(str[i])) { int t; sscanf(&str[i],"%d",&t); si.push(t); while(isdigit(str[i])) i++; } else if(str[i]=='+') { int s1=si.top...
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(str); | ^~~~ | getw
s800462257
p02263
C++
#include<bits/stdc++.h> using namespace std; int main() { stack<int> si; char str[10010]; gets(str); for(int i=0;i<strlen(str);i++) { //printf("%d\n",i); if(isdigit(str[i])) { int t; sscanf(&str[i],"%d",&t); si.push(t); while(isdigit(str[i])) i++; } else if(str[i]=='+') { int s1=si.top...
a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(str); | ^~~~ | getw
s697909201
p02263
C++
#include<bits/stdc++.h> #include<string.h> using namespace std; int main() { stack<int> si; char str[10010]; gets(str); for(int i=0;i<strlen(str);i++) { //printf("%d\n",i); if(isdigit(str[i])) { int t; sscanf(&str[i],"%d",&t); si.push(t); while(isdigit(str[i])) i++; } else if(str[i]=='+') ...
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(str); | ^~~~ | getw
s777900736
p02263
C++
#include <stdio.h> #include <stdlib.h> char stack[200]; int top = 0; bool isFull() { if (top == 199) { return true; } return false; } bool isEmpty() { if (top == -1) { return true; } return false; } int pop() { if (isEmpty()) { printf("Stack is empty.\n"); exit(EXIT_FAILURE); } return stack[top--];...
a.cc: In function 'int main(int, char**)': a.cc:48:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 48 | while (scanf_s("%s",s,200) != EOF) | ^~~~~~~ | scanf
s586038410
p02263
C++
#include <stdio.h> #include <stdlib.h> int stack[100]; int top = 0; bool isFull() { if (top == 199) { return true; } return false; } bool isEmpty() { if (top == -1) { return true; } return false; } int pop() { if (isEmpty()) { printf("Stack is empty.\n"); exit(EXIT_FAILURE); } return stack[--top]; ...
a.cc: In function 'int main(int, char**)': a.cc:48:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 48 | while (scanf_s("%s",s,200) != EOF) | ^~~~~~~ | scanf
s071079407
p02263
C++
#include <iostream> #include <cstdio> #include <stack> using namespace std; stack<int >S; int main(){ char s[100]; int a,b; while(scanf("%s",s) != EOF){ if(s[0] == '+'){ a = top();pop(); b = top();pop(); S.push(a+b); } else if(s[0] == '-'){ b = top();pop(); a = top();pop(); S.push(a-b); ...
a.cc: In function 'int main()': a.cc:13:29: error: 'top' was not declared in this scope 13 | a = top();pop(); | ^~~ a.cc:13:35: error: 'pop' was not declared in this scope; did you mean 'popen'? 13 | a = top();pop(); | ...
s578327037
p02263
C++
#include<cstring> #include<stdlib.h> using namespace std; int top,s[1000]; void push(int x){ s[++top]=x; } int pop(){ top--; return s[top+1]; } int main(){ int a,b; top=0; char s[100]; while(scanf("%s",s)!=EOF){ if(s[0]=='+'){ a=pop(); b=pop(); push(a+b); } else if(s[0]=='-'){ a=pop(); ...
a.cc: In function 'int main()': a.cc:19:7: error: 'scanf' was not declared in this scope 19 | while(scanf("%s",s)!=EOF){ | ^~~~~ a.cc:19:22: error: 'EOF' was not declared in this scope 19 | while(scanf("%s",s)!=EOF){ | ^~~ a.cc:3:1: note: 'EOF' is defined in header '<cstdio>...
s348583277
p02263
C++
#include<string.h> #include<stdlib.h> using namespace std; int top,s[1000]; void push(int x){ s[++top]=x; } int pop(){ top--; return s[top+1]; } int main(){ int a,b; top=0; char s[100]; while(scanf("%s",s)!=EOF){ if(s[0]=='+'){ a=pop(); b=pop(); push(a+b); } else if(s[0]=='-'){ b=pop(); ...
a.cc: In function 'int main()': a.cc:19:7: error: 'scanf' was not declared in this scope 19 | while(scanf("%s",s)!=EOF){ | ^~~~~ a.cc:19:22: error: 'EOF' was not declared in this scope 19 | while(scanf("%s",s)!=EOF){ | ^~~ a.cc:3:1: note: 'EOF' is defined in header '<cstdio>...
s093924743
p02263
C++
#include<stdafx.h> #include<iostream> #include<string> using namespace std; int top, S[1000]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a, b; top = 0; string s; getline(cin, s); for (int i = 0; i < sizeof(s); i++) { if (s[i] == '+') { a = pop(); b = ...
a.cc:1:9: fatal error: stdafx.h: No such file or directory 1 | #include<stdafx.h> | ^~~~~~~~~~ compilation terminated.
s824367949
p02263
C++
using namespace std; string s; int top,S[1000]; void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } int main() { int a, b; top = 0; while(cin>>s){ if (s[0] == '+') { a = pop(); b = pop(); push(a + b); } else if (s[0] == '-') { b = pop(); a = pop(); push(a - b); ...
a.cc:2:1: error: 'string' does not name a type 2 | string s; | ^~~~~~ a.cc: In function 'int main()': a.cc:18:15: error: 'cin' was not declared in this scope 18 | while(cin>>s){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by addin...
s889618063
p02263
C++
#include<iostream> #include<stack> #include<string> #include <cstdlib> int main(){ std::stack<int> s; std::string b; int bu; while(std::cin>>b;){ if(b=="+"){ bu=s.top(); s.pop(); s.top()+=bu; } else if(b=="-"){ bu=s.top(); s.pop(); s.top()=s.top()-bu; } else if(b=="*"){ bu=s.top();...
a.cc: In function 'int main()': a.cc:9:26: error: expected ')' before ';' token 9 | while(std::cin>>b;){ | ~ ^ | ) a.cc:9:27: error: expected primary-expression before ')' token 9 | while(std::cin>>b;){ | ...
s544632127
p02263
C++
#include <cstdio> #include <cctype> #include <cstdlib> using namespace std; const int MAX = 100; int top, s[MAX + 1]; void initialize() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX; } void push(int x) { if (isFull()) { fprintf(stderr, "error: stack is full\n"); ...
a.cc: In function 'int main()': a.cc:41:3: error: 'string' was not declared in this scope 41 | string str; | ^~~~~~ a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 3 | #include <cstdlib> +++ |+#include <string> 4 | using namesp...
s969737456
p02263
C++
#include<iostream> #include<stdio.h> #include<stack> #include<string.h> using namespace std; int main(){ stack <int> S; int a,b,i=0,j=0,size=0,check=0; char kani[1000]; char m[11]={'0','1','2','3','4','5','6','7','8','9'}; while(cin>>kani!=EOF){ for(j=1;j<10;j++){ if(kani[i]==m[j]){ S.push(i); break;...
a.cc: In function 'int main()': a.cc:12:24: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'int') 12 | while(cin>>kani!=EOF){ | ~~~~~~~~~^~ | | | std::basic_istream<char> a.cc:12:24: note: candidate: 'operat...
s878788386
p02263
C++
#include<iostream> #include<stdio.h> #include<stack> #include<string.h> using namespace std; int main(){ stack <int> S; int a,b,i=0,j=0; string kani; while(cin>>kani){ if(kani=='+'){ b=S.top(); S.pop(); a=S.top(); S.pop(); S.push(a+b); } else if(kani=='-'){ b=S.top(); S.pop(); a=S.top...
a.cc: In function 'int main()': a.cc:12:24: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 12 | if(kani=='+'){ | ~~~~^~~~~ | | | | | char | ...
s060716781
p02263
C++
#include<iostream> #include<stdio.h> #include<stack> #include<string> #include<cstdlib> using namespace std; int main(){ stack <int> S; int a,b,; string kani; while(cin>>kani){ if(kani=="+"){ b=S.top(); S.pop(); a=S.top(); S.pop(); S.push(a+b); } else if(kani=="-"){ b=S.top(); S.pop(); ...
a.cc: In function 'int main()': a.cc:10:17: error: expected unqualified-id before ';' token 10 | int a,b,; | ^
s434892718
p02263
C++
#include<iostream> #include <string> using namespace std; int main(){ int S[100],top=0; string s; while(cin>>s){ if(s=='+') S[top-1]+=S[top--]; else if(s=='-') S[top-1]-=S[top--]; else if(s=='*') S[top-1]*=S[top--]; else S[++top]=atoi(s.c_str()); } cout<<S[1]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | if(s=='+') S[top-1]+=S[top--]; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic...
s430142788
p02263
C++
#include <iostream> using namespace std; int data[MAX + 1]; int head = 0; void push(int num) { data[head] = num; head++; } int pop() { head--; return data[head]; } int main() { int a, b; char ch[100]; while (cin >> ch) { switch (ch[0]) { case '+': a = pop(); b = pop(); push(b...
a.cc:4:10: error: 'MAX' was not declared in this scope 4 | int data[MAX + 1]; | ^~~ a.cc: In function 'void push(int)': a.cc:8:7: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 8 | data[head] = num; | ^ a.cc: In function 'int pop()': a.cc:14:14...
s760961721
p02263
C++
#include <stdlib.h> #include <iostream> #include <stack> using namespace std; int main() { stack<char> S; char ch; while (cin >> ch) { switch(ch) { case '+': char a = S.top(); char b = S.top(); S.pop(); S.pop(); S.push(a+b); ...
a.cc: In function 'int main()': a.cc:21:22: error: jump to case label 21 | case '-': | ^~~ a.cc:16:26: note: crosses initialization of 'char b' 16 | char b = S.top(); | ^ a.cc:15:26: note: crosses initialization of '...
s674437388
p02263
C++
#include <stdlib.h> #include <iostream> #include <stack> using namespace std; int main() { stack<int> S; char ch; while (cin >> ch) { switch(ch) { case "+": int a = S.top(); int b = S.top(); S.pop(); S.pop(); S.push(a+b); ...
a.cc: In function 'int main()': a.cc:14:22: error: conversion from 'const char*' to 'int' in a converted constant expression 14 | case "+": | ^~~ a.cc:14:22: error: could not convert '"+"' from 'const char [2]' to 'int' 14 | case "+": | ...
s873336537
p02263
C++
#include <stdlib.h> #include <iostream> #include <stack> using namespace std; int main() { stack<int> S; char ch; while (cin >> ch) { switch(ch) { case '+': int a = S.top(); int b = S.top(); S.pop(); S.pop(); S.push(a+b); ...
a.cc: In function 'int main()': a.cc:21:22: error: jump to case label 21 | case '-': | ^~~ a.cc:16:25: note: crosses initialization of 'int b' 16 | int b = S.top(); | ^ a.cc:15:25: note: crosses initialization of 'int...
s382834350
p02263
C++
#include <stdlib.h> #include <iostream> #include <stack> using namespace std; int main() { stack<int> S; char ch; int a, b; while (cin >> ch) { switch(ch) { case '+': a = S.top(); b = S.top(); S.pop(); S.pop(); S.push(a+b); ...
a.cc: In function 'int main()': a.cc:37:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 37 | S.push(atoi(ch)) | ^~ | | | char In file included from /usr/incl...
s399932625
p02263
C++
#include <stdlib.h> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<int> S; string ch; int a, b; while (cin >> ch) { switch(ch) { case '+': a = S.top(); S.pop(); b = S.top(); S.pop(); ...
a.cc: In function 'int main()': a.cc:14:20: error: switch quantity not an integer 14 | switch(ch) | ^~ a.cc:38:33: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 38 | S.push(atoi(ch)); | ...
s732852556
p02263
C++
#include <stdlib.h> #include <iostream> #include <stack> #include <string> using namespace std; int main() { stack<int> S; string ch; int a, b; while (cin >> ch) { switch(ch[0]) { case '+': a = S.top(); S.pop(); b = S.top(); S.pop(); ...
a.cc: In function 'int main()': a.cc:38:33: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 38 | S.push(atoi(ch)); | ^~ | | | std::string...
s547949462
p02263
C++
1 2 + 3 4 + *
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 2 + 3 4 + * | ^
s832938091
p02263
C++
// Elementary data structures - Stack // hhttp://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A using System; using System.Linq; namespace ALDS1_3_A { class Program { public Program() {} public static void Main() { new Program().Calc(); } ...
a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Linq; | ^~~~~~ a.cc:8:15: error: expected ':' before 'Program' 8 | public Program() {} | ...
s454363259
p02263
C++
#include <iostream> #include <string> using namespace std; const int max_size = 101; int que[max_size]; int top = 0; bool isFull() { return top == max_size; } bool isEmpty() { return top == 0; } void push(int key) { if (isFull()) cout << "Stack is Full" << endl; que[top++] = key; } int pop() { if (isEmpty(...
a.cc: In function 'int main(int, char**)': a.cc:56:38: error: 'stoi' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 56 | push(string::stoi(s)); | ^~~~
s996545076
p02263
C++
#include <iostream> #include <string> using namespace std; const int max_size = 101; int que[max_size]; int top = 0; bool isFull() { return top == max_size; } bool isEmpty() { return top == 0; } void push(int key) { if (isFull()) cout << "Stack is Full" << endl; que[top++] = key; } int pop() { if (isEmpty(...
a.cc: In function 'int main(int, char**)': a.cc:56:37: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'cstr'; did you mean 'c_str'? 56 | push(atoi(s.cstr())); | ^~~~ | ...
s045571731
p02263
C++
#include <iostream> #include <string> #include <stdlib> using namespace std; const int max_size = 101; int que[max_size]; int top = 0; bool isFull() { return top == max_size; } bool isEmpty() { return top == 0; } void push(int key) { if (isFull()) cout << "Stack is Full" << endl; que[top++] = key; } int pop...
a.cc:3:10: fatal error: stdlib: No such file or directory 3 | #include <stdlib> | ^~~~~~~~ compilation terminated.
s919357042
p02263
C++
#include <iostream> #include <string> #include <stdlib.h> using namespace std; const int max_size = 101; int que[max_size]; int top = 0; bool isFull() { return top == max_size; } bool isEmpty() { return top == 0; } void push(int key) { if (isFull()) cout << "Stack is Full" << endl; que[top++] = key; } int p...
a.cc: In function 'int main(int, char**)': a.cc:57:37: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'cstr'; did you mean 'c_str'? 57 | push(atoi(s.cstr())); | ^~~~ | ...
s913246170
p02263
C++
#include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<stack> #include<stdlib.h> struct s{ char str[120];}; using namespace std; stack<int> st; int main(){ struct s a; int x,y; while(scanf("%s",a.str)!=EOF){ if(a.str[0]=='+'){ x=st.top(); st.pop(); y=st.top(); st.pop(); st.push(x+y); } else i...
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<stack> #include<stdlib.h> struct s{ char str[120];}; using namespace std; stack<int> st; int main(){ struct s a; int x,y; while(scanf("%s",a.str)!=EOF){ if(a.str[0]=='+...
s672624275
p02263
C++
#include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<stack> #include<stdlib.h> struct s{ char str[120];}; using namespace std; stack<int> st; int main(){ struct s a; int x,y; while(scanf("%s",a.str)!=EOF){ if(a.str[0]=='+'){ x=st.top(); st.pop(); y=st.top(); st.pop(); st.push(x+y); } else i...
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<stack> #include<stdlib.h> struct s{ char str[120];}; using namespace std; stack<int> st; int main(){ struct s a; int x,y; while(scanf("%s",a.str)!=EOF){ if(a.str[0]=='+...