submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s533809105
p02263
C++
#include<iostream> using namespace std; int top, S[200]; int pop() { top--; return S[top+1] } void push(x) { S[++top] = x; } int main() { char x; int a, b; while(cin >> x != EOF) { if(x = '+') { a = pop(); b = pop(); push(a + b); } else if (x = '-') { a = pop(); b = pop(); push(a - b); } els...
a.cc: In function 'int pop()': a.cc:8:24: error: expected ';' before '}' token 8 | return S[top+1] | ^ | ; 9 | } | ~ a.cc: At global scope: a.cc:11:6: error: variable or field 'push' declared void 11 | void push(x)...
s998783071
p02263
C++
#include<iostream> using namespace std; #include<cstdio> int top, S[200]; int pop() { top--; return S[top+1] } void push(x) { S[++top] = x; } int main() { char x; int a, b; while(cin >> x != EOF) { if(x = '+') { a = pop(); b = pop(); push(a + b); } else if (x = '-') { a = pop(); b = pop(); pus...
a.cc: In function 'int pop()': a.cc:9:24: error: expected ';' before '}' token 9 | return S[top+1] | ^ | ; 10 | } | ~ a.cc: At global scope: a.cc:12:6: error: variable or field 'push' declared void 12 | void push(x)...
s752527831
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namesapce std; int S[1000],top; 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); ...
a.cc:4:7: error: expected nested-name-specifier before 'namesapce' 4 | using namesapce std; | ^~~~~~~~~
s397687253
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000],top; 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){ if (s == '+'){ a = pop(); b = pop(); push(a + b); } else if (s =...
a.cc: In function 'int main()': a.cc:22:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if (s == '+'){ | ~~^~~~~~ a.cc:27:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 27 | else if (s...
s546425962
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> #include<cstdlib> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ stack<int> s; int a, b; top = 0; while (cin >> s){ if (s == '+'){ a = pop(); b = pop(); push(a + b);...
a.cc: In function 'int main()': a.cc:19:9: error: 'stack' was not declared in this scope 19 | stack<int> s; | ^~~~~ a.cc:5:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>' 4 | #include<cstdlib> +++ |+#include <stack> 5 | using...
s217779918
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> #include<cstdlib> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ stack<int> s; string st; int a, b; top = 0; while (cin >> st){ if (st == "+"){ a = pop(); b = pop(); ...
a.cc: In function 'int main()': a.cc:19:9: error: 'stack' was not declared in this scope 19 | stack<int> s; | ^~~~~ a.cc:5:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>' 4 | #include<cstdlib> +++ |+#include <stack> 5 | using...
s068373200
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> #include<cstdlib> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ stack<int> s; string st; int a, b; top = 0; while (cin >> st){ if (st == "+"){ a = pop(); b = pop(); ...
a.cc: In function 'int main()': a.cc:19:9: error: 'stack' was not declared in this scope 19 | stack<int> s; | ^~~~~ a.cc:5:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>' 4 | #include<cstdlib> +++ |+#include <stack> 5 | using...
s370061965
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ char s[100] int a, b; top = 0; while (scanf("%d",s){ if (s[0] == "+"){ a = pop(); b = pop(); push(a + b); } else i...
a.cc: In function 'int main()': a.cc:19:9: error: expected initializer before 'int' 19 | int a, b; | ^~~ a.cc:21:27: error: 's' was not declared in this scope 21 | while (scanf("%d",s){ | ^ a.cc:21:29: error: expected ')' before '{' token 21 | ...
s211087666
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ char s[100]; int a, b; top = 0; while (scanf("%d",s){ if (s[0] == "+"){ a = pop(); b = pop(); push(a + b); } else ...
a.cc: In function 'int main()': a.cc:21:29: error: expected ')' before '{' token 21 | while (scanf("%d",s){ | ~ ^ | ) a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if (s[0] == ...
s972089762
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ char s[100]; int a, b; top = 0; while (scanf("%d",s)!=EOF){ if (s[0] == "+"){ a = pop(); b = pop(); push(a + b); } ...
a.cc: In function 'int main()': a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if (s[0] == "+"){ | ~~~~~^~~~~~ a.cc:27:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 27 | else...
s179512303
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ char s[100]; int a, b; top = 0; while (scanf("%s",s)!=EOF){ if (s[0] == "+"){ a = pop(); b = pop(); push(a + b); } ...
a.cc: In function 'int main()': a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if (s[0] == "+"){ | ~~~~~^~~~~~ a.cc:27:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 27 | else...
s297374472
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000],top; void push(int x){ S[++top] = x; } int pop(){ top--; return S[top + 1]; } int main(){ char s[100]; int a, b; top = 0; while (scanf("%s",s)!=EOF){ if (s[0] == '+'){ a = pop(); b = pop(); push(a + b); } ...
a.cc: In function 'int main()': a.cc:38:30: error: invalid conversion from 'char*' to 'int' [-fpermissive] 38 | push(s); | ^ | | | char* a.cc:8:15: note: initializing argument 1 of 'void...
s382368788
p02263
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int S[1000], top; void push(int x){ S[top++] = x; } void pop(){ top--; return S[top + 1]; } int main(){ int a, b; char s[200]; top = 0; while (scanf("%s", s) != EOF){ if (s[0] == '+'){ a = pop(); b = pop(); push(a + b); ...
a.cc: In function 'void pop()': a.cc:13:25: error: return-statement with a value, in function returning 'void' [-fpermissive] 13 | return S[top + 1]; | ~~~~~~~~~^ a.cc: In function 'int main()': a.cc:22:32: error: void value not ignored as it ought to be 22 | a...
s190271185
p02263
C++
#include<string> #include<cctype> #include<iostream> #include<cstdio> #include<cmath> #include<queue> #include<stack> using namespace std; #define inf 0x3f3f3f3f typedef long long ll; const int maxn = 1000 + 8; int sta[maxn]; char c[100]; int top ; /* bool isEmpty(int sta[]) { return !top; }*/ int pop() { top-...
a.cc: In function 'int main()': a.cc:69:12: error: 'strcmp' was not declared in this scope 69 | if(strcmp(c,"+") == 0){ | ^~~~~~ a.cc:8:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include<stack> +++ |+#include <cstrin...
s128982531
p02263
C++
#include<iostream> using namespace std; int top, S[1000]; class myStack { public: void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } private: int top = 0; int S[1000] = { 0 }; }; int main() { char s[100]; myStack sta; while (scanf_s("%s", s) != EOF) { if (s[0] == '+') { ...
a.cc: In function 'int main()': a.cc:25:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 25 | while (scanf_s("%s", s) != EOF) { | ^~~~~~~ | scanf
s143328139
p02263
C++
#include<iostream> using namespace std; int top, S[1000]; class myStack { public: void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } private: int top = 0; int S[1000] = { 0 }; }; int main() { char s[100]; myStack sta; while (scanf("%s", s) != EOF) { if (s[0] == '+') { in...
a.cc: In function 'int main()': a.cc:42:34: error: cast from 'char*' to 'int' loses precision [-fpermissive] 42 | sta.push((int)s); | ^~~~~~
s277185090
p02263
C++
#include<iostream> using namespace std; int top, S[1000]; class myStack { public: void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } private: int top = 0; int S[1000] = { 0 }; }; int main() { char s[100]; myStack sta; while (scanf("%s", s) != EOF) { if (s[0] == '+') { in...
a.cc: In function 'int main()': a.cc:42:34: error: cast from 'char*' to 'int' loses precision [-fpermissive] 42 | sta.push((int)s); | ^~~~~~
s085954983
p02263
C++
#include<iostream> #include<string> #include <strstream> using namespace std; class myStack { public: void push(int x) { S[++top] = x; } int pop() { top--; return S[top + 1]; } private: int top = 0; int S[1000] = { 0 }; }; int main() { string s; myStack sta; cin >> s; while (cin.eof()) { /* if (s[0...
In file included from /usr/include/c++/14/backward/strstream:50, from a.cc:3: /usr/include/c++/14/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated...
s448860267
p02263
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> void push(int); int pop(void); int isEmpty(void); int isFull(void); int top=0,S[100]; int main(){ int x,a,b; char s[100]; while(scanf("%s",s)!=EOF){ if ( s[0] == '+' ){ a=pop(); b=pop(); push(a+b); } else if ( s[0] == '-' ){ ...
a.cc: In function 'int pop()': a.cc:55:1: warning: control reaches end of non-void function [-Wreturn-type] 55 | } | ^ /usr/bin/ld: /tmp/ccdpJUli.o: in function `push(int)': a.cc:(.text+0x10a): undefined reference to `isFull()' collect2: error: ld returned 1 exit status
s234229178
p02263
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char symbol[100]; int num[99],x=0; while(scanf("%s",symbol)!=EOF){ if(symbol=='+'){ num[x-2]=num[x-2]+num[x-1]; x--; } else if(symbol=='-'){ num[x-2]=num[x-2]-num[x-1]; x--; } else if(symbol=='*'){ num[x-2]=n...
a.cc: In function 'int main()': a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(symbol=='+'){ | ~~~~~~^~~~~ a.cc:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(symbol=='-'){ | ~~~~~~^~...
s684045685
p02263
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char symbol[100]; int num[99],x=0; while(scanf("%s",symbol)!=EOF){ if(symbol=='+'){ num[x-2]=num[x-2]+num[x-1]; x--; } else if(symbol=='-'){ num[x-2]=num[x-2]-num[x-1]; x--; } else if(symbol=='*'){ num[x-2]=n...
a.cc: In function 'int main()': a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(symbol=='+'){ | ~~~~~~^~~~~ a.cc:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(symbol=='-'){ | ~~~~~~^~...
s793151283
p02263
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> void push(int); int pop(void); int isEmpty(void); int isFull(void); int top=0,S[100]; int main(){ int x,a,b; char s[100]; while(scanf("%s",s)!=EOF){ if ( s[0] == '+' ){ a=pop(); b=pop(); push(a+b); } else if ( s[0] == '-' ){ ...
/usr/bin/ld: /tmp/cci8ryPz.o: in function `main': a.cc:(.text+0x16): undefined reference to `pop()' /usr/bin/ld: a.cc:(.text+0x1e): undefined reference to `pop()' /usr/bin/ld: a.cc:(.text+0x30): undefined reference to `push(int)' /usr/bin/ld: a.cc:(.text+0x3f): undefined reference to `pop()' /usr/bin/ld: a.cc:(.text+0x...
s431509727
p02263
C++
#include <stdio.h> #define STACK_SIZE 100 #define MAX 100 int stack[STACK_SIZE]; int stack_size = 0; int pop() { if (stack_size <= 0) return 0; return stack[--stack_size]; } int push(int a) { stack[stack_size++] = a; } int is_digit(char *s) { if (*s == '+' || *s =='-') { s++; if (*s >= '0' && *s <= '9') ret...
a.cc: In function 'int push(int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^ a.cc: At global scope: a.cc:100:17: error: 's' does not name a type 100 | s++; | ^ a.cc:101:25: error: expected declaration before '}' tok...
s023920567
p02263
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <cstdio> #include <cstring> #include <cmath> #include <bitset> #include <climits> #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for (int i=(a);i<(b);i++...
a.cc: In constructor 'stack::stack()': a.cc:31:17: error: class 'stack' does not have any field named '_top' 31 | stack():_top(0){} | ^~~~ a.cc: In function 'int main()': a.cc:50:40: error: expected ')' before '}' token 50 | if(c >= '0' && c <= '9' | ...
s999922887
p02263
C++
#include <iostream> #include <stack> #include <string> #include <sstream> using namespace std; ?? int main() { ????????stack<int> S; ?? ????????string expr; ????????getline(cin, expr); // 1??????????????? ?? ????????istringstream is(expr); // ???????????????????????? ?? ????????while(!is.eof()){ ????????????????string ...
a.cc:6:1: error: expected unqualified-id before '?' token 6 | ?? | ^
s801437079
p02263
C++
#include<cstdio> #include<cstdlib> #include<iostream> using namespace std; ?? int top,S[101]; ?? void push(int x){ ????????S[++top] = x; } ?? int pop(){ ????????return S[top--]; } ?? int main(){ ????????char str[10]; ????????int a,b; ????????top = 0; ?????????? ????????while(scanf("%s",str) != EOF){ ????????????????if(...
a.cc:5:1: error: expected unqualified-id before '?' token 5 | ?? | ^ a.cc:7:1: error: expected unqualified-id before '?' token 7 | ?? | ^ a.cc:11:1: error: expected unqualified-id before '?' token 11 | ?? | ^ a.cc:15:1: error: expected unqualified-id before '?' token 15 | ?? | ^
s610443224
p02263
C++
#include <iostream> #include <string> #include <stack> #include <sstream> #include <cctype> #include <algorithm> using namespace std; int CalcRPN(stack<string>& st) { string str = st.top(); st.pop(); if (all_of(str.cbegin(), str.cend(), isdigit)) return stoi(str); char c = str[0]; switch (c)...
a.cc: In function 'int CalcRPN(std::stack<std::__cxx11::basic_string<char> >&)': a.cc:14:15: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::const_iterator, std::__cxx11::basic_string<char>::const_iterator, <unresolved overloaded function type>)' 14 | if (all_of(str.cbegin(), st...
s286508830
p02263
C++
#include <iostream> #include <string> #include <stack> #include <sstream> #include <cctype> #include <algorithm> using namespace std; int CalcRPN(stack<string>& st) { string str = st.top(); st.pop(); char c = str[0]; switch (c) { case '+': return CalcRPN(st) + CalcRPN(st); ...
a.cc:47:21: error: 'str' was not declared in this scope; did you mean 'std'? 47 | stringstream ss(str); | ^~~ | std a.cc:49:5: error: expected unqualified-id before 'while' 49 | while (getline(ss, item, ' ')) { | ^~~~~ a.cc:53:5: error: 'cout' ...
s561987407
p02263
C++
#include <bits/stdc++.h> using namespace std; int main(){ stack<long long>st; char c; while(scanf("%s",c)!=EOF){ if(c=='+'){ long long a=st.top(); st.pop(); long long b=st.top(); st.pop(); st.push(a+b); } if(c=='-'){ long long a=st.top(); st.pop(); long long b=st.top(); st.pop(); ...
a.cc: In function 'int main()': a.cc:37:38: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 37 | st.push(atoi(c)); | ^ | | | char In file incl...
s282214714
p02263
C++
int main() { stack<int> operands; vector<string> inputs; string cur; while (!cin.eof()) { cin >> cur; inputs.push_back(cur); } for (int i = 0; i < (int) inputs.size(); ++i) { string cur = inputs[i]; if (is_digit(cur)) { operands.push(atoi(cur.c_str...
a.cc: In function 'int main()': a.cc:2:5: error: 'stack' was not declared in this scope 2 | stack<int> operands; | ^~~~~ a.cc:2:11: error: expected primary-expression before 'int' 2 | stack<int> operands; | ^~~ a.cc:3:5: error: 'vector' was not declared in this scope 3 | ...
s522046847
p02263
C++
#include <iostream> #include <cmath> #include <cstdio> #include <algorithm> #include <string> #include <sstream> #include <vector> #include <stack> #include <memory> #include <stdlib.h> using namespace std; stack<int> a; void solve(); int main(){ //freopen("/Users/mac/Desktop/C++?¨????/test/test.txt", "r", stdin);...
a.cc: In function 'void solve()': a.cc:25:13: error: 'strncmp' was not declared in this scope 25 | if (strncmp(c, "+", 1)==0) { | ^~~~~~~ a.cc:11:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 10 | #include <stdlib.h> +++ |+...
s225958659
p02263
C++
#include <ctype.h> #include <cassert> #include <cstdio> using namespace std; namespace { int stackptr = -1; int stack[100]; inline int Pop() { return stack[stackptr--]; } inline void Push(int n) { stackptr++; stack[stackptr] = n; } } // namespace int main() { char buf[1000000]; while (scanf("%s", buf)...
a.cc: In function 'int main()': a.cc:30:12: error: 'atoi' was not declared in this scope 30 | Push(atoi(p)); | ^~~~
s781849477
p02263
C++
#include <ctype.h> #include <cassert> #include <cstdio> #include <ctdlib> using namespace std; namespace { int stackptr = -1; int stack[100]; inline int Pop() { return stack[stackptr--]; } inline void Push(int n) { stackptr++; stack[stackptr] = n; } } // namespace int main() { char buf[1000000]; while...
a.cc:4:10: fatal error: ctdlib: No such file or directory 4 | #include <ctdlib> | ^~~~~~~~ compilation terminated.
s442411350
p02263
C++
#include<iostream> #include<string> #include<sstream> using namespace std; class Stack(){ private: int sp; int S[100]; public: Stack(){sp=0;} bool isFull() const{return (sP==100);} bool isEmpty() const{return (sp==0);} void push(int d); int top(); void pop(); }; void Stack::push(int d) { if(isFull()) retur...
a.cc:6:13: error: expected unqualified-id before ')' token 6 | class Stack(){ | ^ a.cc:19:23: error: invalid use of incomplete type 'class Stack' 19 | void Stack::push(int d) | ^ a.cc:6:7: note: forward declaration of 'class Stack' 6 | class Stack(){ | ...
s832451504
p02263
C++
#include<iostream> #include<string> #include<sstream> using namespace std; class Stack{ private: int sp; int S[100]; public: Stack(){sp=0;} bool isFull() const{return (sP==100);} bool isEmpty() const{return (sp==0);} void push(int d); int top(); void pop(); }; void Stack::push(int d) { if(isFull()) return;...
a.cc: In member function 'bool Stack::isFull() const': a.cc:12:37: error: 'sP' was not declared in this scope; did you mean 'sp'? 12 | bool isFull() const{return (sP==100);} | ^~ | sp a.cc: In member function 'void Stack::pus...
s473583587
p02263
C++
#include <iostream> #include <string> #include <sstream> #include <list> #include <algorythm> #include <ctype.h> using namespace std; int main(int argc, char** argv) { list<int> l; l.push_back(0); list<int>::iterator top=l.begin(); string expr; getline(cin,expr); istringstream is(expr); int...
a.cc:5:10: fatal error: algorythm: No such file or directory 5 | #include <algorythm> | ^~~~~~~~~~~ compilation terminated.
s803457485
p02263
C++
#include<iostream> #include<string> #include<sstream> using namespace std; class Stack{ private: int sp; int S[100]; public: Stack() {sp=0;} bool isFULL() const {return(sp==100);} bool isEmpty() const {return(sp==0);} void push(int d); int top(); void pop(); }; void Stack::push(int d){ if(isFull()) retu...
a.cc: In member function 'void Stack::push(int)': a.cc:21:5: error: 'isFull' was not declared in this scope; did you mean 'isFULL'? 21 | if(isFull()) | ^~~~~~ | isFULL a.cc: In function 'int main()': a.cc:40:2: error: 'stringexpr' was not declared in this scope 40 | stringexpr; | ^~~~...
s190420711
p02263
C++
#include<iostream> #include<string> #include<sstream> using namespace std; class Stack{ private: int sp; int S[100]; public: Stack(){ xp=0; } bool ixFull() const{ return(sp==100); } bool isEmpty() const{ return(sp==0); } void push(int d); int top(); void pop(); }; void Stack::push(int d) { if(isFull...
a.cc: In constructor 'Stack::Stack()': a.cc:12:17: error: 'xp' was not declared in this scope; did you mean 'sp'? 12 | xp=0; | ^~ | sp a.cc: In member function 'void Stack::push(int)': a.cc:27:12: error: 'isFull' was not declared in this scope; did you mean...
s376610872
p02263
C++
#include<iostream> #include<string> #include<sstream> using namespace std; class Stack{ private: int sp; int S[100]; public: Stack(){ sp=0; } bool ixFull() const{ return(sp==100); } bool isEmpty() const{ return(sp==0); } void push(int d); int top(); void pop(); }; void Stack::push(int d) { if(isFull...
a.cc: In member function 'void Stack::push(int)': a.cc:27:12: error: 'isFull' was not declared in this scope; did you mean 'ixFull'? 27 | if(isFull()) | ^~~~~~ | ixFull a.cc: At global scope: a.cc:31:6: error: no declaration matches 'void Stack::top()' 31 | void Stack::to...
s646617725
p02263
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <stack> using namespace std; const int INF = 0x3f3f3f3f; int main() { char str[255]; stack<int> s; gets(str); int ans = 0; for(int i = 0; i < strlen(str); i += 2) { if(str[i] == '+') { int temp1 = s.t...
a.cc: In function 'int main()': a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(str); | ^~~~ | getw
s832362069
p02263
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <stack> using namespace std; const int INF = 0x3f3f3f3f; int main() { char str[255]; stack<int> s; gets(str); int ans = 0; for(unsigned int i = 0; i < strlen(str); i += 2) { if(str[i] == '+') { int te...
a.cc: In function 'int main()': a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(str); | ^~~~ | getw
s174989516
p02263
C++
#include <iostream> #include <string> #include <stack> using namespace std; int main(){ string s; stack<int> v; while(cin >> s){ if(s == "+" || s == "*" || s == "-"){ a = v.top(); v.pop(); b = v.top(); v.pop(); if(s == "+"){ v.push(a+b); } else if(s == "*"){ v.push(a*b); } else{...
a.cc: In function 'int main()': a.cc:11:25: error: 'a' was not declared in this scope 11 | a = v.top(); | ^ a.cc:13:25: error: 'b' was not declared in this scope 13 | b = v.top(); | ^ a.cc:29:14: error: no ...
s903468769
p02263
C++
#include <iostream> #include <string> #include <stack> using namespace std; int main(){ string s; stack<int> v; int a,b; while(cin >> s){ if(s == "+" || s == "*" || s == "-"){ a = v.top(); v.pop(); b = v.top(); v.pop(); if(s == "+"){ v.push(a+b); } else if(s == "*"){ v.push(a*b); ...
a.cc: In function 'int main()': a.cc:30:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 30 | cout << v.pop() << endl; | ~~~~ ^~ ~~~~~~~ | | | | | void | std::ostre...
s860569559
p02263
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s226885920
p02263
C++
#include<iostream> #include<cstdlib> #include<stack> using namespace std; int trace(stack<int> S){ for(int i=0;i<S.size();i++){ cout << S.top() << endl; S.pop(); } } int main(){ int a,b; string s; stack<int> S; while(cin >> s){ if(s[0]=='+'){ a=S.top(); S.pop(); b=S.top#include<io...
a.cc:20:20: error: stray '#' in program 20 | b=S.top#include<iostream> | ^ a.cc: In function 'int trace(std::stack<int>)': a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type] 10 | } | ^ a.cc: In function 'int main()': a.cc:20:17: error:...
s291701776
p02263
C++
#include <cstdint> #include <string> #include "problems.hpp" using namespace std; #define ARRAY_SIZE 256 int32_t array[ARRAY_SIZE]; int32_t index = 0; void stack_push(int32_t data) { array[index] = data; index++; } bool stack_pop(int32_t &data) { if (index > 0) { index--; data = array[index]; ret...
a.cc:4:10: fatal error: problems.hpp: No such file or directory 4 | #include "problems.hpp" | ^~~~~~~~~~~~~~ compilation terminated.
s979008735
p02263
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int top, S[1000]; int pop(){ top--; return S[top+1]; } void push(int x){ S[++top] = x; } int main(){ int a, b; top = 0; char s[100]; while (cin >> s) { // while (scanf("%s", s) != EOF) { if (s[0] == '+'){ a = pop()...
a.cc: In function 'int main()': a.cc:37:19: error: request for member 'c_str' in 's', which is of non-class type 'char [100]' 37 | push(atoi(s.c_str())); | ^~~~~
s341535389
p02263
C++
#include <stdio.h> #include <iostream> #include <utility> using namespace std; int main(void) { Operand operand; char buf[200][8] = {"\0"}; for (int i = 0; cin >> buf[i]; i++); int result; for (int i = 0; buf[i][0] != '\0'; i++) { if (buf[i][0] >= '0' && buf[i][0] <= '9') { operand.add(atoi(buf[i])); ...
a.cc: In function 'int main()': a.cc:8:9: error: 'Operand' was not declared in this scope; did you mean 'srand'? 8 | Operand operand; | ^~~~~~~ | srand a.cc:16:25: error: 'operand' was not declared in this scope; did you mean 'srand'? 16 | operand.add(a...
s049931192
p02263
C++
#include <stdio.h> #include <iostream> #include <utility> using namespace std; class Operand { private: int stack[100] = {0}; int state = 0; public: void add(int x); int calc(char symbol); } void Operand::add(int x) { stack[state] = x; state++; } int Operand::calc(char symbol) { if (symbol == '+') { stack[s...
a.cc:13:2: error: expected ';' after class definition 13 | } | ^ | ;
s277137397
p02263
C++
#include <iostream> #include <cstdio> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cstdlib> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <list> #include <string> #include <stack> #include <cstring> #include <set> #include <map> #include <climits> #include <ca...
a.cc: In function 'int main()': a.cc:53:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'top' 53 | a = s.top();s.pop(); | ^~~ a.cc:53:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop' 53...
s350102729
p02263
C++
#include <iostream> #include <cstdio> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cstdlib> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <list> #include <string> #include <stack> #include <cstring> #include <set> #include <map> #include <climits> #include <ca...
a.cc: In function 'int main()': a.cc:52:14: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int') 52 | if (s[0] == '+'){ | ^ a.cc:57:19: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int') 57 | else if (s[0] == '-'){ ...
s569401732
p02263
C++
#include <iostream> #include <cstdio> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cstdlib> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <list> #include <string> #include <stack> #include <cstring> #include <set> #include <map> #include <climits> #include <ca...
a.cc: In function 'int main()': a.cc:28:14: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int') 28 | if (s[0] == '+'){ | ^ a.cc:33:19: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int') 33 | else if (s[0] == '-'){ ...
s666696660
p02263
C++
#include <iostream> #include <cstdio> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cstdlib> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <list> #include <string> #include <stack> #include <cstring> #include <set> #include <map> #include <climits> #include <ca...
a.cc: In function 'int main()': a.cc:44:27: error: 'class std::stack<int>' has no member named 'c_str' 44 | s.push(atoi(s.c_str()); | ^~~~~
s944988473
p02263
C++
#include <iostream> #include <cstdio> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <cstdlib> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <list> #include <string> #include <stack> #include <cstring> #include <set> #include <map> #include <climits> #include <ca...
a.cc: In function 'int main()': a.cc:44:36: error: expected ')' before ';' token 44 | s.push(atoi(ss.c_str()); | ~ ^ | )
s509287494
p02263
C++
#include <stdio.h> #define N 200 #define Max 1000000 int top; int S[N]; int pop(){ return S[top--]; } void init(){ top = 0; } void push(int x){ S[++top] = x; } int main(){ char s[Max]; int a,b; init(); while(scanf("%s",s)!=EOF){ if(!strcmp(s,"+")){ a = pop(); b = pop(); push(a+b); } else if(!...
a.cc: In function 'int main()': a.cc:25:21: error: 'strcmp' was not declared in this scope 25 | if(!strcmp(s,"+")){ | ^~~~~~ a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+...
s808411338
p02263
C++
#include<math.h> #include<stdio.h> #include<string.h> #include<stdlib.h> char character; int stack[110]; int num = 0; int main() { while (scanf("%c", character) != EOF) { if(character == '+') { stack[num-1] += stack[num]; num--; } else if(character == '-') { ...
a.cc: In function 'int main()': a.cc:25:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 25 | stack[num+1] = atoi(character); | ^~~~~~~~~ | | | char In file included ...
s114701779
p02263
C++
#include<math.h> #include<stdio.h> #include<string.h> #include<stdlib.h> char character[10]; int stack[110]; int num = 0; int main() { while (scanf("%s", character) != EOF) { if(character == '+') { stack[num-1] += stack[num]; num--; } else if(character == '-') { ...
a.cc: In function 'int main()': a.cc:12:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(character == '+') { | ~~~~~~~~~~^~~~~~ a.cc:16:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | else if(character =...
s488315065
p02263
C++
class Stack: def __init__(self): self.values = [] self.n = 0 def pop(self): if self.n == 0: raise Exception("stack underflow") else: v = self.values[-1] del self.values[-1] self.n -= 1 return v def push(self,x): ...
a.cc:2:9: error: expected class-name before '__init__' 2 | def __init__(self): | ^~~~~~~~ a.cc:2:9: error: expected '{' before '__init__' a.cc:2:18: error: 'self' was not declared in this scope 2 | def __init__(self): | ^~~~
s580412926
p02263
C++
include <iostream> #include <cstdlib> #include <stack> using namespace std; ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/deque:62, from /usr/include/c++/14/stack:62, from a.cc:3: /usr/include/c++/14/ext/type_...
s281872239
p02263
C++
#include <iostream> #include <string> #include <stack> #include <cstdlib> using namespace std; int main() { string s; stack<int> St; while(cin >> s) { if (s == "+") { int n = St.top(); St.pop(); n += St.top(); St.pop(); St.push(n); ...
a.cc: In function 'int main()': a.cc:35:26: error: 'word' was not declared in this scope 35 | St.push(atoi(word.c_str())); | ^~~~
s627874380
p02263
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> #include<set> #include<map> #include<string> #include<functional> #include<queue> #include<stack> #include<math.h> #define INF 999999 #define EPS 1.0e-6 using namespace std; int main() { stack<int> s; char b[315]; scanf("%[^\n]", b); for(in...
a.cc: In function 'int main()': a.cc:23:23: error: 'strlen' was not declared in this scope 23 | for(int I=0;I<strlen(b);I++){ | ^~~~~~ a.cc:12:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<math.h> +++...
s483072926
p02263
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> #include<set> #include<map> #include<string> #include<functional> #include<queue> #include<stack> #include<math.h> #define INF 999999 #define EPS 1.0e-6 using namespace std; int main() { stack<int> s; char b[315]; scanf("%[^\n]", b); for(in...
a.cc: In function 'int main()': a.cc:23:23: error: 'strlen' was not declared in this scope 23 | for(int I=0;I<strlen(b);I++){ | ^~~~~~ a.cc:12:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<math.h> +++...
s472450439
p02263
C++
#include <iostream> #include <string> #include <stack> #include <cstdlib> using namespace std; int main() { int a, b; string s; stack<int> St; while(cin >> s) { if (s == "+") { b = St.top(); St.pop(); a = St.top(); St.pop() St.push(a+b); } ...
a.cc: In function 'int main()': a.cc:17:35: error: expected ';' before 'St' 17 | a = St.top(); St.pop() | ^ | ; 18 | St.push(a+b); | ~~ a.cc:22:35: error: expected ';' bef...
s094164703
p02263
C++
klk
a.cc:1:1: error: 'klk' does not name a type 1 | klk | ^~~
s079915318
p02263
C++
}
a.cc:1:1: error: expected declaration before '}' token 1 | } | ^
s188796311
p02263
C++
#include<iostream> #include<string> #include<cstdio> #define SIZE 200 class stack { public: void init(); void push(char ch); char pop(); private: char a[SIZE] = {0}; int tos; }; void stack::init() { tos = 0; } void stack::push(char ch) { a[tos] = ch; tos++; } char stack::pop() { tos--; return a[tos]; } ...
a.cc:41:27: error: stray '\' in program 41 | if (ed == \n) { | ^ a.cc: In function 'int main()': a.cc:41:28: error: 'n' was not declared in this scope 41 | if (ed == \n) { | ^
s118677996
p02263
C++
template <typename T, unsigned N> class stack { public: stack() : _data{new T[N]}, _top(0) {} ~stack() {delete[] _data;} T top() const { return _data[_top]; } bool isEmpty() const { return _top == 0; } T pop() { ass...
a.cc: In member function 'T stack<T, N>::pop()': a.cc:13:13: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive] 13 | assert(_top != 0); | ^~~~~~ a.cc:13:13: note: (if you use '-fpermissive', G++ wi...
s213910686
p02263
C++
#include <iostream> #include <sstream> #include <vector> template <typename T, unsigned N> class stack { public: stack() : _data{new T[N]}, _top(0) {} ~stack() {delete[] _data;} T top() const { return _data[_top]; } bool isEmpty() const { return _t...
a.cc: In member function 'T stack<T, N>::pop()': a.cc:16:13: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive] 16 | assert(_top != 0); | ^~~~~~ a.cc:16:13: note: (if you use '-fpermissive', G++ wi...
s618993253
p02263
C++
#include <iostream> #include <sstream> #include <vector> #include <cassert> template <typename T, unsigned N> class stack { public: stack() : _data{new T[N]}, _top(0) {} ~stack() {delete[] _data;} T top() const { return _data[_top]; } bool isEmpty() const { ...
a.cc:65:16: error: expected constructor, destructor, or type conversion before '(' token 65 | std::getline(std::cin, input); | ^ a.cc:68:13: error: expected constructor, destructor, or type conversion before '(' token 68 | std::copy(std::istream_iterator<std::string>(ss), | ...
s694492734
p02263
C++
#include <iostream> #include <sstream> #include <vector> #include <cassert> #include <algorithm> template <typename T, unsigned N> class stack { public: stack() : _data{new T[N]}, _top(0) {} ~stack() {delete[] _data;} T top() const { return _data[_top]; } boo...
a.cc:66:16: error: expected constructor, destructor, or type conversion before '(' token 66 | std::getline(std::cin, input); | ^ a.cc:69:13: error: expected constructor, destructor, or type conversion before '(' token 69 | std::copy(std::istream_iterator<std::string>(ss), | ...
s231611683
p02263
C++
#include <iostream> #include <vector> #include <cassert> #include <algorithm> #include <sstream> template <typename T, unsigned N> class stack { public: stack() : _data{new T[N]}, _top(0) {} ~stack() {delete[] _data;} T top() const { return _data[_top]; } boo...
a.cc:66:16: error: expected constructor, destructor, or type conversion before '(' token 66 | std::getline(std::cin, input); | ^ a.cc:69:13: error: expected constructor, destructor, or type conversion before '(' token 69 | std::copy(std::istream_iterator<std::string>(ss), | ...
s305139246
p02263
C++
#include <stdio.h> #include <string.h> #include <stdlib.h> int top,S[1000]; void push(int x){ S[++top]=x; } int pop(int x){ top--; return S[top+1]; } int main(){ int a,b; top=0; char ch[1000]; while(scanf("%s",&ch)!=EOF){ if(ch=='+'){ a=pop(); b=pop(); push(a+b); } else if(ch=='-...
a.cc: In function 'int main()': a.cc:17:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 17 | if(ch=='+'){ | ~~^~~~~ a.cc:18:12: error: too few arguments to function 'int pop(int)' 18 | a=pop(); | ~~~^~ a.cc:8:5: note: declared here 8 | int ...
s996964169
p02263
C++
#include <iostream> #include <stack> //std::stack #include <string> #include <stdlib.h> using namespace std; std::stack<int> myStack; int dataPop(void) { int data = myStack.top(); myStack.pop(); return data; } void calcAndPush(string container) { int data01, data02; if(container == "+") //add...
a.cc: In function 'void calcAndPush(std::string)': a.cc:20:26: error: 'data_pop' was not declared in this scope; did you mean 'dataPop'? 20 | data01 = data_pop(); | ^~~~~~~~ | dataPop a.cc:26:26: error: 'data_pop' was not declared in this ...
s493350317
p02263
C++
#include <iostream> #include <cstdlib> #include <stack> using namespace std; int main(){ int a,b; string ch; srack<int> S; while(scanf("%s",ch)!=EOF){ if(ch[0]=='+'){ a=S.top();S.pop(); b=S.top();S.pop(); S.push(a+b); } else if(ch[0]=='-'){ b=S.top();S.pop(); a=S.top();S.po...
a.cc: In function 'int main()': a.cc:8:3: error: 'srack' was not declared in this scope 8 | srack<int> S; | ^~~~~ a.cc:8:9: error: expected primary-expression before 'int' 8 | srack<int> S; | ^~~ a.cc:11:9: error: 'S' was not declared in this scope 11 | a=S.top();S.pop(); ...
s425634814
p02263
C++
#include <stdio.h> #include <cstdlib> #include <stack> using namespace std; int main(){ int a,b; string ch; stack<int> S; while(scanf("%s",ch)!=EOF){ if(ch[0]=='+'){ a=S.top();S.pop(); b=S.top();S.pop(); S.push(a+b); } else if(ch[0]=='-'){ b=S.top();S.pop(); a=S.top();S.pop...
a.cc: In function 'int main()': a.cc:7:3: error: 'string' was not declared in this scope 7 | string ch; | ^~~~~~ a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 3 | #include <stack> +++ |+#include <string> 4 | using namespace ...
s109784861
p02263
C++
#include <cstdio> #include <cstdlib> #include <stack> int main(){ int a,b; string ch; stack<int> S; while(scanf("%s",ch)!=EOF){ if(ch[0]=='+'){ a=S.top();S.pop(); b=S.top();S.pop(); S.push(a+b); } else if(ch[0]=='-'){ b=S.top();S.pop(); a=S.top();S.pop(); S.push(a-b);...
a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope; did you mean 'stdin'? 6 | string ch; | ^~~~~~ | stdin a.cc:7:3: error: 'stack' was not declared in this scope; did you mean 'std::stack'? 7 | stack<int> S; | ^~~~~ | std::stack In file i...
s200008331
p02263
C++
#include <cstdio> #include <cstdlib> #include <iostrem> #include <stack> using namespace std; int main(){ int a,b; char ch[1000]; stack<int> S; while(scanf("%s",ch)!=EOF){ if(ch[0]=='+'){ a=S.top();S.pop(); b=S.top();S.pop(); S.push(a+b); } else if(ch[0]=='-'){ b=S.top();S.pop();...
a.cc:3:10: fatal error: iostrem: No such file or directory 3 | #include <iostrem> | ^~~~~~~~~ compilation terminated.
s301850771
p02263
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <stack> using namespace std; int main(){ int a,b; char ch[1000]; stack<int> S; while(scanf("%s",ch)!=EOF){ if(ch[0]=='+'){ a=S.top();S.pop(); b=S.top();S.pop(); S.push(a+b); } else if(ch[0]=='-'){ b=S.top();S.pop()...
a.cc: In function 'int main()': a.cc:24:22: error: request for member 'c_str' in 'ch', which is of non-class type 'char [1000]' 24 | S.push(atoi(ch.c_str())); | ^~~~~
s532048615
p02263
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <stack> int main(){ int a,b; char ch[1000]; stack<int> S; while(scanf("%s",ch)!=EOF){ if(ch[0]=='+'){ a=S.top();S.pop(); b=S.top();S.pop(); S.push(a+b); } else if(ch[0]=='-'){ b=S.top();S.pop(); a=S.top();S.p...
a.cc: In function 'int main()': a.cc:8:3: error: 'stack' was not declared in this scope; did you mean 'std::stack'? 8 | stack<int> S; | ^~~~~ | std::stack In file included from /usr/include/c++/14/stack:63, from a.cc:4: /usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std::stack...
s590206195
p02263
C++
#include <iostream> #include <stack> using namespace std; char s[100]; int main(){ stack<int> st; while(~scanf("%s", s)){ if(s[0]=='+'){ int a = st.top(); st.pop(); int b = st.top(); st.pop(); st.push(a+b); } else if(s[0]=='-'){ int a = st.top(); st.pop(); int b = st.top(); st.pop(...
a.cc: In function 'int main()': a.cc:34:40: error: 'len' was not declared in this scope; did you mean 'mblen'? 34 | for(int i=0; i<len(s); i++){ | ^~~ | mblen
s650660725
p02263
C++
#include <iostream> #include <stack> using namespace std; char s[100]; int main(){ stack<int> st; while(~scanf("%s", s)){ if(s[0]=='+'){ int a = st.top(); st.pop(); int b = st.top(); st.pop(); st.push(a+b); } else if(s[0]=='-'){ int a = st.top(); st.pop(); int b = st.top(); st.pop(...
a.cc: In function 'int main()': a.cc:34:40: error: 'strlen' was not declared in this scope 34 | for(int i=0; i<strlen(s); i++){ | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstrin...
s680576470
p02263
C++
#include<iostream> #include<cstdio> using namespace std; int top, S[1000]; void push(int x){ top++; 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 + b); } else i...
a.cc: In function 'int main()': a.cc:22:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 22 | while (scanf_s("%s",s)!=EOF) { | ^~~~~~~ | scanf
s013036066
p02263
C++
#include<iostream> #include<cstdio> #include<stack> using namespace std; int main() { stack<int>S; int a, b, c; string s; while (cin >> s) { if (s[0] == '+') { a = S.top(); S.pop(); b = S.top(); S.pop(); S.push(a + b); } else if (s[0] == '-') { b = S.top(); S.pop(); a = S.top(); S.pop(); S...
a.cc: In function 'int main()': a.cc:28:53: error: expected class-name before '(' token 28 | S.push(atoi(s.~_String_alloc())); | ^
s967052635
p02263
C++
#include<stdio.h> #include<string.h> #include<stdlib.h> typedef float Item; static Item *s; static int N; void STACKinit(int); int STACKempty(void); void STACKpush(Item); Item STACKpop(void); int main(void){ char a[300]; int i=0; scanf("%[^\n]",a); int n=strlen(a); int stackin=0; STACKinit(214748364); for...
a.cc: In function 'void STACKinit(int)': a.cc:44:11: error: invalid conversion from 'void*' to 'Item*' {aka 'float*'} [-fpermissive] 44 | s=malloc(maxN*sizeof(Item)); | ~~~~~~^~~~~~~~~~~~~~~~~~~ | | | void*
s090561547
p02263
C++
#include<cstdio> #include<cstdlib> #include<iostream> #include<stack> #include<string> #define REP(i,n) for(int (i)=0;i<(n);i++) using namespace std; int main(){ stack <int>is; int a,b,x; string s; while(){ if(s[0] == '+'){ a = is.top();is.pop(); b = is.top();is.pop(); is.push...
a.cc: In function 'int main()': a.cc:19:9: error: expected primary-expression before ')' token 19 | while(){ | ^
s107853207
p02263
C++
#include<cstdio> #include<cstdlib> #include<iostream> #include<stack> #include<string> #define REP(i,n) for(int (i)=0;i<(n);i++) using namespace std; int main(){ stack <int>is; int a,b,x; string s; while(){ if(s[0] == '+'){ a = is.top();is.pop(); b = is.top();is.pop(); is.push...
a.cc: In function 'int main()': a.cc:19:9: error: expected primary-expression before ')' token 19 | while(){ | ^
s960265433
p02263
C++
#include<iostream> #include<string> int eval(std::stack<std::string> &stc){ int a, b; if(stc.top == "+"){ stc.pop; a = stac.top; stc.pop; b = stac.top; stc.pop; return a+b; } else if (stc.top == "-") { stc.pop; a = stc.top; stc.pop; ...
a.cc:4:15: error: 'stack' is not a member of 'std' 4 | int eval(std::stack<std::string> &stc){ | ^~~~~ 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 | #include<string> a...
s252119677
p02263
C++
#include<iostream> #include<string> #include<stack> int eval(std::stack<std::string> &stc){ int a, b; if(stc.top == "+"){ stc.pop; a = stac.top; stc.pop; b = stac.top; stc.pop; return a+b; } else if (stc.top == "-") { stc.pop; a = stc.top; ...
a.cc: In function 'int eval(std::stack<std::__cxx11::basic_string<char> >&)': a.cc:7:16: error: invalid operands of types '<unresolved overloaded function type>' and 'const char [2]' to binary 'operator==' 7 | if(stc.top == "+"){ | ~~~~~~~ ^~ ~~~ | | | | | ...
s525686295
p02263
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> int top, S[1000] void push(int x) { /* topを加算してからその位置へ挿入 */ S[++top] = x } int pop() { top--; /* topが指していた要素を返す */ return S[top+1]; } int main() { int a, b; top = 0; char s[100]; while( scanf("%s", s) != EOF ) { if ( s[0] == '+' ) { a ...
a.cc:7:1: error: expected initializer before 'void' 7 | void push(int x) { | ^~~~ a.cc: In function 'int pop()': a.cc:15:10: error: 'S' was not declared in this scope 15 | return S[top+1]; | ^ a.cc: In function 'int main()': a.cc:27:7: error: 'push' was not declared in this scope 27 | ...
s627417446
p02263
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> int top, S[1000] void push(int x) { /* topを加算してからその位置へ挿入 */ S[++top] = x; } int pop() { top--; /* topが指していた要素を返す */ return S[top+1]; } int main() { int a, b; top = 0; char s[100]; while( scanf("%s", s) != EOF ) { if ( s[0] == '+' ) { ...
a.cc:7:1: error: expected initializer before 'void' 7 | void push(int x) { | ^~~~ a.cc: In function 'int pop()': a.cc:15:10: error: 'S' was not declared in this scope 15 | return S[top+1]; | ^ a.cc: In function 'int main()': a.cc:27:7: error: 'push' was not declared in this scope 27 | ...
s504743501
p02263
C++
#include<iostram> #include<cstdlib> #include<stack> using namespace std; int main() { stack<int> S; int a, b, x; string s; while ( cin >> s ){ if ( s[0] == '+' ) { a = S.top(); S.pop(); b = S.top(); S.pop(); S.push(a + b); } else if ( s[0] == '-' ) { b = S.top(); S.pop(); ...
a.cc:1:9: fatal error: iostram: No such file or directory 1 | #include<iostram> | ^~~~~~~~~ compilation terminated.
s676728737
p02263
C++
#include <iostream> #include <vector> #include <string> using namespace std; int const MAX = 100; int top; int s[MAX]; void initalise() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX - 1; } void push(int x) { if (isFull()) cout << "エラー(オーバーフロー)" << endl; top++; s[top...
a.cc: In function 'int main()': a.cc:35:17: error: 'istream_iterator' does not name a type 35 | using ite_t = istream_iterator<string>; | ^~~~~~~~~~~~~~~~ a.cc:36:3: error: 'ite_t' was not declared in this scope; did you mean 'time_t'? 36 | ite_t it(cin); | ^~~~~ | time_t...
s432513646
p02263
C++
#include <iostream> #include <vector> #include <string> using namespace std; int const MAX = 100; int top; int s[MAX]; void initalise() { top = 0; } bool isEmpty() { return top == 0; } bool isFull() { return top >= MAX - 1; } void push(int x) { if (isFull()) cout << "エラー(オーバーフロー)" << endl; top++; s[top...
a.cc: In function 'int main()': a.cc:35:17: error: 'istream_iterator' does not name a type 35 | using ite_t = istream_iterator<string>; | ^~~~~~~~~~~~~~~~ a.cc:36:3: error: 'ite_t' was not declared in this scope; did you mean 'time_t'? 36 | ite_t it(cin); | ^~~~~ | time_t...
s347027912
p02263
C++
#include<stdio.h> #include<algorithm> #include <iostream> using namespace std; int top,s[100]; void push(int x) { s[top++]=x; return; } int pop() { int x=s[--top]; return x; } int main() { top=0; int i=0,a,b; string str; while(cin>>str) { if(str=='+') { ...
a.cc: In function 'int main()': a.cc:25:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 25 | if(str=='+') | ~~~^~~~~ | | | | | char | std::string {aka std::__cx...
s134672695
p02263
C++
#include<bits/stdc++.h> #define SIZE 100005 using namespace std; typedef long long ll; typedef pair<int,int> P; struct Stack{ ll table[1000]; ll top; void init(){ top=0; } bool empty(){ return top==0; } void push(ll x){ table[top]=x; top++; } ll pop(){ if(empty()) return 0; top--; return table[t...
a.cc: In function 'int main()': a.cc:37:15: error: 'init' was not declared in this scope; did you mean 'int'? 37 | stack,init(); | ^~~~ | int a.cc: In function 'll calc(ll, std::string, ll)': a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type] ...
s998472525
p02263
C++
#include<bits/stdc++.h> #define SIZE 100005 using namespace std; typedef long long ll; typedef pair<int,int> P; const int INF = 100000000; stack<ll> stack; ll calc(llx,string op,ll y){ if(op=="+") return x+y; if(op=="-") return x-y; if(op=="*") return x*y; } int main(){ string str; ll numA,numB; while(cin >>...
a.cc:10:9: error: 'llx' was not declared in this scope; did you mean 'll'? 10 | ll calc(llx,string op,ll y){ | ^~~ | ll a.cc:10:20: error: expected primary-expression before 'op' 10 | ll calc(llx,string op,ll y){ | ^~ a.cc:10:26: error: expected primary-express...
s977460344
p02263
C++
#include <iostream> #include <string> #include <cstdlib> using namespace std; class Stack{ public: int S[101]; int top; Stack(); void push(int x); int pop(); bool isEmpty(); bool isFull(); }; Stack::Stack(){ S[0] = 0; top = 0; return; } void Stack::push(int x){ top++; S[top] = x; return; } int Stack::...
a.cc: In function 'int main()': a.cc:73:25: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 73 | sscanf_s(w.data(), "%d", &dum); | ^~~~~~~~ | sscanf
s522052754
p02263
C++
#include <iostream> #include <string> #include <cstdio> using namespace std; class Stack{ public: int S[101]; int top; Stack(); void push(int x); int pop(); bool isEmpty(); bool isFull(); }; Stack::Stack(){ S[0] = 0; top = 0; return; } void Stack::push(int x){ top++; S[top] = x; return; } int Stack::p...
a.cc: In function 'int main()': a.cc:73:25: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'? 73 | sscanf_s(w.data(), "%d", &dum); | ^~~~~~~~ | sscanf
s806446197
p02263
C++
#include <stdio.h> #include <stack> using namespace std; stack<int> S; int main() { int a, b; char str[1000]; while(~scanf("%s", str)) { if(str[0] == '+') { a = S.top();S.pop(); b = S.top();S.pop(); S.push(a+b); } else if(str[0] == '-') { a ...
a.cc: In function 'int main()': a.cc:29:20: error: 'atoi' was not declared in this scope 29 | S.push(atoi(str)); | ^~~~
s784001897
p02263
C++
#include <stdio.h> #include <stack> using namespace std; stack<int> S; int main() { int a, b; char str[1000]; while(~scanf("%s", str)) { if(str[0] == '+') { a = S.top();S.pop(); b = S.top();S.pop(); S.push(a+b); } else if(str[0] == '-') { a ...
a.cc: In function 'int main()': a.cc:29:20: error: 'atoi' was not declared in this scope 29 | S.push(atoi(str)); | ^~~~