submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s183539052 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x;
int i=0;
int n[100];
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
i--;
} else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
i--;
} else if ( s[0] == '*' ){
x[i-2] = x[i-1... | main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
13 | x[i-2] = x[i-1]+x[i-2];
| ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vector
13 | x[i-2] = x[i-1]+x[i-2];
| ^
main.c:13:18: error: subscripted value i... |
s753629814 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
main(){
int x;
int i=0;
int n[100];
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
i--;
} else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
i--;
} else if ( s[0] == '*' ){
x[i-2] = x[i-1]*x[... | main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
5 | main(){
| ^~~~
main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
13 | x[i-2] = x[i-1]+x[i-2];
| ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vect... |
s310035351 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x;
int i;
int n[100];
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
x[i-2] = x[i-1]+x[i-2];
i = i + 1;
} else if ( s[0] == '-' ){
x[i-2] = x[i-2]-x[i-1];
i = i + 1;
} else if ( s[0] == '*' ){
x[i-2] = x... | main.c: In function 'main':
main.c:13:2: error: subscripted value is neither array nor pointer nor vector
13 | x[i-2] = x[i-1]+x[i-2];
| ^
main.c:13:11: error: subscripted value is neither array nor pointer nor vector
13 | x[i-2] = x[i-1]+x[i-2];
| ^
main.c:13:18: error: subscripted value i... |
s026138611 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
main(){
int x;
int i;
int n[100];
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
n[i-2] = n[i-1] + n[i-2];
i = i + 1;
} else if ( s[0] == '-' ){
n[i-2] = n[i-2] - n[i-1];
i = i + 1;
} else if ( s[0] == '*' ){
n[i-2] =... | main.c:6:2: error: return type defaults to 'int' [-Wimplicit-int]
6 | main(){
| ^~~~
main.c: In function 'main':
main.c:23:9: error: assignment to expression with array type
23 | n = atoi(s);
| ^
|
s716858213 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x;
int i;
int n[100];
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
n[i-2] = n[i-1] + n[i-2];
i = i + 1;
} else if ( s[0] == '-' ){
n[i-2] = n[i-2] - n[i-1];
i = i + 1;
} else if ( s[0] == '*' ){
n[i-... | main.c: In function 'main':
main.c:23:9: error: assignment to expression with array type
23 | n = atoi(s);
| ^
|
s501885931 | p02263 | C | int StackEmpty(int *);
void Push(int *,int);
int top=0;
int main(){
int x=0,a=0,b=0,s2[100];
char s1[100];
while( scanf("%s",s1) != EOF ){
if ( s1[0] == '+' ){
a = Pop(s2);
b = Pop(s2);
Push(s2,a+b);
}
else if ( s1[0] == '-' ){
a=Pop(s2);
b=Pop(s2);
Push(s2,b-a... | main.c: In function 'main':
main.c:10:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
10 | while( scanf("%s",s1) != EOF ){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int StackEmpty(int *);... |
s521647646 | p02263 | C++ | #include<stdlib.h>
int S[100];
int top = 0;
void push(int x)
{
S[++top] = x;
return;
}
int pop()
{
--top;
return S[top + 1];
}
int main()
{
char s[6];
char ch;
int i = 0;
while (ch = getchar())
{
if (ch != '\n')
{
if (ch != ' ')
{
s[i] = ch;
++i;
}
else
{
s[i] = '\0';
if... | a.cc: In function 'int main()':
a.cc:24:21: error: 'getchar' was not declared in this scope
24 | while (ch = getchar())
| ^~~~~~~
a.cc:2:1: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include<stdlib.h>
+++ |+#inc... |
s439619138 | p02263 | C++ | #include‘’stdio.h"
#include<iostream>
using namespace std;
int top = 0;
int A[200] = { 0 };
void push(int n)
{
++top;
A[top] = n;
return;
}
int pop()
{
return A[--top];
}
int main()
{
char str[6] = { '\0' };
while (scanf("%s", str) != EOF)
{
if (str[0] == '+')
{
push(pop() + pop());
}
else if (st... | a.cc:1:2: error: extended character ‘ is not valid in an identifier
1 | #include‘’stdio.h"
| ^
a.cc:1:2: error: extended character ’ is not valid in an identifier
a.cc:1:2: error: invalid preprocessing directive #include\U00002018\U00002019stdio
1 | #include‘’stdio.h"
| ^~~~~~~~~~~~~~
a.cc:1:18: w... |
s540143618 | p02263 | C++ | #include<iostream>
#include<cctype>
#include<stack>
using namespace std;
int main(){
stack<int> s;
char str[200];
while(cin.getline(str,200)){
for(int i=0;i<strlen(str);i++){
if(isdigit(str[i]))
s.push(str[i]-'0');
else if(str[i] != ' '){
int... | a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
11 | for(int i=0;i<strlen(str);i++){
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<stack>
+++... |
s262871955 | p02263 | C++ | #include<iostream>
#include<cctype>
#include<stack>
using namespace std;
int main(){
stack<int> s;
char str[200];
while(cin.getline(str,200)){
for(int i=0;i<strlen(str);i++){
if(isdigit(str[i]))
s.push(str[i]-'0');
else if(str[i] != ' '){
int... | a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
11 | for(int i=0;i<strlen(str);i++){
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<stack>
+++... |
s512561391 | p02263 | C++ | #include<iostream>
#include<cctype>
#include<stack>
using namespace std;
int main(){
stack<int> s;
char str[200];
while(cin.getline(str,200)){
for(int i=0;i<strlen(str);i++){
if(isdigit(str[i]))
s.push(str[i]-'0');
else if(str[i] != ' '){
int... | a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
11 | for(int i=0;i<strlen(str);i++){
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<stack>
+++... |
s352839122 | p02263 | C++ | a
| a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s567903213 | p02263 | C++ | a
| a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s464697041 | p02263 | C++ | #include<iostream>
#include<stack>
#include<cctype>
#include<cstdlib>
using namespace std;
int main(void){
stack<int> st;
string ch;
while(cin >> ch){
if(isdigit(ch[0])){
st.push((int)ch[0]);
}
else{
int a = st.top();
st.pop();
int b = st.top();
st.pop();
if(ch == '+') st.push(b + a);
if(... | a.cc: In function 'int main()':
a.cc:19:31: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
19 | if(ch == '+') st.push(b + a);
| ~~ ^~ ~~~
| | |
|... |
s067717800 | p02263 | C++ | #include<iostream>
#include<stack>
#include<cctype>
#include<cstdlib>
using namespace std;
int main(void){
stack<int> st;
string ch;
while(cin >> ch){
if(isdigit(ch[0])){
st.push((int)ch);
}
else{
int a = st.top();
st.pop();
int b = st.top();
st.pop();
if(ch == '+') st.push(b + a);
if(ch ... | a.cc: In function 'int main()':
a.cc:12:33: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
12 | st.push((int)ch);
| ^~~~~~~
a.cc:19:31: error: no match for 'operator==' (operand types are 'std::string' {... |
s610722329 | p02263 | C++ | #include<iostream>
#include<stack>
#include<cctype>
#include<cstdlib>
using namespace std;
int main(void){
stack<int> st;
string ch;
while(cin >> ch){
if(isdigit(ch)){
st.push((int)ch);
}
else{
int a = st.top();
st.pop();
int b = st.top();
st.pop();
if(ch == '+') st.push(b + a);
if(ch == ... | a.cc: In function 'int main()':
a.cc:11:27: error: no matching function for call to 'isdigit(std::string&)'
11 | if(isdigit(ch)){
| ~~~~~~~^~~~
In file included from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
fr... |
s977292932 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
osikomi(int s[]){
for(int i = 0;i<200;i++){
s[i] = s[i+1];
}
}
int main(){
int l, i=0;
int s[200] = {};
string x;
while(cin>>x){
if(x == "+"){
s[0] += s[1];
// osikomi(s);
}
else if(x == "/"){
s[0] /= s[1];
// osiko... | a.cc:3:1: error: ISO C++ forbids declaration of 'osikomi' with no type [-fpermissive]
3 | osikomi(int s[]){
| ^~~~~~~
a.cc: In function 'int osikomi(int*)':
a.cc:7:1: warning: no return statement in function returning non-void [-Wreturn-type]
7 | }
| ^
|
s447554232 | p02263 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s938240275 | p02263 | C++ | #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;
top = 0;
char s[100];
while(scanf("%s", s) != EOF) { //Ctr + D
if(s[0] == '+') {
a = pop();
b = pop();
push(a +... | a.cc: In function 'int pop()':
a.cc:12:8: error: expected ';' before 'return'
12 | top--
| ^
| ;
13 | return S[top+1];
| ~~~~~~
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
14 | }
| ^
|
s886909485 | p02263 | C++ | #include <cstdio>
#include <stack>
int main(){
std::stack<int> st;
char s[10];
int op1,op2;
while(scanf("%s",s)!=EOF){
switch(s[0]){
case '+':
op2 = st.top();
st.pop();
op1 = st.top();
st.pop();
st.push(op1+op2);
b... | a.cc: In function 'int main()':
a.cc:33:21: error: 'atoi' was not declared in this scope
33 | st.push(atoi(s));
| ^~~~
|
s843804927 | p02263 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
//#include <bits/stdc++.h>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int... | a.cc: In function 'int main()':
a.cc:44:13: error: expected ',' or ';' before 'a'
44 | a.push(x);
| ^
|
s087601077 | p02263 | C++ | #include <string>
#include <stack>
#include <stdlib.h>
using namespace std;
int a, b,c;
int main()
{
string word;
stack <int> S;
while (cin >> word)
{
if (word == "+")
{
a = S.top(); S.pop();
b = S.top(); S.pop();
S.push(a + b);
}
else if (word == "-")
{
a = S.top(); S.pop();
b = S.top(); ... | a.cc: In function 'int main()':
a.cc:11:16: error: 'cin' was not declared in this scope
11 | while (cin >> word)
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <stdlib.h>
+++ |+#include <iost... |
s656013535 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int top,S[1000];
int main(){
int a,b;(
top=0;
char s[100];
while(cin>>s){
if(s[0]=='+'){
a=pop();
b=pop();
push(a+b)
}
else if(s[0]=='-'){
b=pop();
a=pop();
pus... | a.cc: In function 'int main()':
a.cc:6:10: error: expected ')' before ';' token
6 | top=0;
| ^
| )
a.cc:5:13: note: to match this '('
5 | int a,b;(
| ^
a.cc:10:15: error: 'pop' was not declared in this scope; did you mean 'top'?
10 | a=pop()... |
s196857997 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int top,S[1000];
int main(){
int a,b;(
top=0;
char s[100];
while(cin>>s){
if(s[0]=='+'){
a=pop();
b=pop();
push(a+b);
}
else if(s[0]=='-'){
b=pop();
a=pop();
pu... | a.cc: In function 'int main()':
a.cc:6:10: error: expected ')' before ';' token
6 | top=0;
| ^
| )
a.cc:5:13: note: to match this '('
5 | int a,b;(
| ^
a.cc:10:15: error: 'pop' was not declared in this scope; did you mean 'top'?
10 | a=pop()... |
s781103120 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int stack[1000];
int kazu;
void push(int j){
stack[++kazu] = j;
}
int pop(){
kazu--;
return stack[kazu+1];
}
int main(){
int l,n;
kazu = 0;
char s[100];
while( scanf("%s", s)!=EOF){
if(s[0] == '+'){
l =pop();
n =pop();
pus... | a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 | stack[++kazu] = j;
| ^
a.cc:9:1: error: extended character ... |
s285488050 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
using namespace std;
int main()
{
int temp=0;
string word;
stack<int> S;
while(cin>>word)
{
if(word=="+")
temp=S.top();S.pop();
S.push(S.top()+temp);S.pop();
}
else if(word=="-")
{
temp=S.top()... | a.cc: In function 'int main()':
a.cc:16:5: error: 'else' without a previous 'if'
16 | else if(word=="-")
| ^~~~
a.cc:28:15: error: no matching function for call to 'std::stack<int>::push(std::string&)'
28 | S.push(word);
| ~~~~~~^~~~~~
In file included from /usr/include/c++/14/... |
s923145417 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | a.cc: In function 'int main()':
a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
27 | gets(s);
| ^~~~
| getw
|
s428818597 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | a.cc: In function 'int main()':
a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
27 | gets(s);
| ^~~~
| getw
|
s543335281 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | a.cc: In function 'int main()':
a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
27 | gets(s);
| ^~~~
| getw
|
s083680627 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | a.cc: In function 'int main()':
a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
27 | gets(s);
| ^~~~
| getw
|
s818910867 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | a.cc: In function 'int main()':
a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
27 | gets(s);
| ^~~~
| getw
|
s257353005 | p02263 | C++ |
#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<cstdlib>
using namespace std;
int main(){
stack<int> s;
int a, b;
string str;
while(cin>>str){
if(str=="+"){
a=s.top(); s.pop();
b=s.top(); s.pop();
... | a.cc: In function 'int main()':
a.cc:29:27: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
29 | }else s.push(atoi(str));
| ^~~
| |
| std::string {aka std::__cxx11::ba... |
s872020456 | p02263 | C++ | #include <iostream>
using namespace std;
class Stack {
public:
void initialize();
bool isEmpty();
bool isFull();
void push(const int);
int pop();
Stack(const int);
~Stack();
private:
int top, STACKSIZE;
vector<int> S;
};
void addition(Stack &s) {
int a = s.pop(), b = s.pop... | a.cc:16:5: error: 'vector' does not name a type
16 | vector<int> S;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:35:14: error: 'N' was not declared in this scope
35 | Stack _s(N);
| ^
a.cc: In constructor 'Stack::Stack(int)':
a.cc:63:5: error: 'vector' was not declared in thi... |
s458118479 | p02263 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:202:8: error: expected unqualified-id before '=' token
202 | char = ch;
| ^
a.cc:212:7: error: 'ch' was not declared in this scope
212 | ch = S[i];
| ^~
|
s613828242 | p02263 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:218:9: error: expected '(' before '{' token
218 | {
| ^
| (
a.cc:218:9: error: expected type-specifier before '{' token
a.cc:217:12: error: expected ')' before '{' token
217 | catch
| ^
| )
218 | ... |
s445133320 | p02263 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:218:9: error: expected '(' before '{' token
218 | {
| ^
| (
a.cc:218:9: error: expected type-specifier before '{' token
a.cc:217:12: error: expected ')' before '{' token
217 | catch
| ^
| )
218 | ... |
s105866756 | p02263 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:217:13: error: expected type-specifier before ')' token
217 | catch()
| ^
|
s717714427 | p02263 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:205:5: error: expected initializer before 'vector'
205 | vector<string> vs = split(T,' ');
| ^~~~~~
a.cc:210:13: error: 'vs' was not declared in this scope
210 | REP(i,SIZ(vs))
| ^~
a.cc:100:38: note: in definition of macro 'REP'
100 | #define... |
s597105118 | p02263 | C++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <stack>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
stack<int> a;
char b[100];
while( scanf("%b", b) != EOF ){
if(b[0]=='+'){
int x = a.top();
a.pop();
int y = a.top... | a.cc: In function 'int main()':
a.cc:40:25: error: 's' was not declared in this scope
40 | a.push(atoi(s));
| ^
|
s949427153 | p02263 | C++ | #include "bits/stdc++.h"
using namespace std;
void push(int A);
int pop(void);
vector<int> S(1000);
int Top = 0;
int main(void) {
string str = "0";
int a, b;
Top = 0;
while (str.c_str != "\n") {
cin >> str;
if (str == "+") {
a = pop();
b = pop();
push(a + b);
}
else if (str == "-") {
b = po... | a.cc: In function 'int main()':
a.cc:15:20: error: invalid use of member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' (did you forget the '()' ?)
15 | while (str.c_str != "\n")... |
s220310301 | p02263 | C++ | #include "bits/stdc++.h"
using namespace std;
void push(int A);
int pop(void);
int S[1000];
int Top = 0;
int main(void) {
char str[100];
int a, b;
Top = 0;
while (scanf("%s", str) != EOF) {
cin >> str;
if (str[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else if (str[0] == '-') {
b = p... | a.cc: In function 'void push(int)':
a.cc:44:11: error: request for member 'at' in 'S', which is of non-class type 'int [1000]'
44 | S.at(Top) = A;
| ^~
a.cc: In function 'int pop()':
a.cc:49:18: error: request for member 'at' in 'S', which is of non-class type 'int [1000]'
49 | ret... |
s679802312 | p02263 | C++ | #include "bits/stdc++.h"
using namespace std;
void push(int A);
int pop(void);
int S[1000];
int Top = 0;
int main(void) {
string str;
int a, b;
Top = 0;
while (str != "-1") {
if (str[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else if (str[0] == '-') {
b = pop();
a = pop();
push(a... | a.cc: In function 'int main()':
a.cc:33:39: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
33 | push(atoi(str.c_str));
... |
s281711786 | p02263 | C++ | #include "bits/stdc++.h"
using namespace std;
void push(int A);
int pop(void);
int S[1000];
int Top = 0;
int main(void) {
string str;
int a, b;
Top = 0;
while (str != "-1") {
cin >> str;
if (str[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else if (str[0] == '-') {
b = pop();
a = po... | a.cc: In function 'int main()':
a.cc:34:39: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
34 | push(atoi(str.c_str));
... |
s349623367 | p02263 | C++ | int a, b;
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s730476321 | p02263 | C++ | #include<iostream>
#include<stack>
#include<string>
#include<cstdlib>
using namespace std;
int main(){
stack<int> S;
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.t... | a.cc: In function 'int main()':
a.cc:12:13: error: 'a' was not declared in this scope
12 | a=S.top();S.pop();
| ^
a.cc:13:13: error: 'b' was not declared in this scope
13 | b=S.top();S.pop();
| ^
a.cc:17:13: error: 'b' was not declared in this scope
1... |
s349706428 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int popStack(stack<int>* stk){
int ret = stk->top();
stk->pop();
return ret;
}
int main(){
string s;
getline(cin,s);
stack<int> stk;
for(int i = 0; i < s.size();i++){
if(s[i] != ' '){
if('0' <= s[i] && s[i] <= '9'){
... | a.cc: In function 'int main()':
a.cc:33:45: error: expected ';' before ':' token
33 | val = popStack(&stk):
| ^
| ;
|
s281447575 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string word;
stack<int> S;
int a,b;
while(cin >> word){
if(word=="+"){
a=S.top();
S.pop();
b=S.top();
S.push(a+b);
}
else if(word=="-"){
a=S.top();
S.pop();
b=S.top();
S.push(a-b);
}
els... | a.cc: In function 'int main()':
a.cc:28:13: error: no matching function for call to 'std::stack<int>::push(std::string&)'
28 | S.push(word);
| ~~~~~~^~~~~~
In file included from /usr/include/c++/14/stack:63,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:160,
... |
s557618712 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string word;
stack<int> S;
int a,b;
while(cin >> word){
if(word=="+"){
a=S.top();
S.pop();
b=S.top();
S.push(a+b);
}
else if(word=="-"){
a=S.top();
S.pop();
b=S.top();
S.push(a-b);
}
els... | a.cc: In function 'int main()':
a.cc:28:23: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'c'
28 | int n=atoi(word.c str())
| ^
a.cc:32:11: error: 'A' was not declared in this scope
32 | cout << A.top() << endl;
| ^
|
s260833131 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string word;
stack<int> S;
int a,b;
while(cin >> word){
if(word=="+"){
a=S.top();
S.pop();
b=S.top();
S.push(a+b);
}
else if(word=="-"){
a=S.top();
S.pop();
b=S.top();
S.push(a-b);
}
els... | a.cc: In function 'int main()':
a.cc:28:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
28 | int n=atoi(word)
| ^~~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included f... |
s595314088 | p02263 | C++ | #include<bits/stdc++.h>
#include <cstdlib>
using namespace std;
int main(){
string word;
stack<int> S;
int a,b;
while(cin >> word){
if(word=="+"){
a=S.top();
S.pop();
b=S.top();
S.push(a+b);
}
else if(word=="-"){
a=S.top();
S.pop();
b=S.top();
S.push(... | a.cc: In function 'int main()':
a.cc:29:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
29 | int n=atoi(word)
| ^~~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included f... |
s266214204 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string word;
stack<int> S;
int a,b;
while(cin >> word){
if(word=="+"){
a=S.top();
S.pop();
b=S.top();
S.push(a+b);
}
else if(word=="-"){
a=S.top();
S.pop();
b=S.top();
S.push(a-b);
}
els... | a.cc: In function 'int main()':
a.cc:28:23: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'c_word'
28 | int n=atoi(word.c_word())
| ^~~~~~
|
s735766966 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
char word;
stack<int> S;
int a,b;
while(cin >> word){
if(word=="+"){
a=S.top();
S.pop();
b=S.top();
S.push(a+b);
}
else if(word=="-"){
a=S.top();
S.pop();
b=S.top();
S.push(a-b);
}
else ... | a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(word=="+"){
| ~~~~^~~~~
a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
15 | else if(word=="-"){
| ~~~~^~~... |
s426226036 | p02263 | C++ | #include <string>
#include <stack>
#include <iostream>
using namespace std;
int main() {
string word;
stack<int> S;
while (cin >> word) {
if (word == "+") {
int a;
a += int n=stoi(S.top());
S.pop();
a += int n=stoi(S.top());
S.pop();
S.push(a);
}
else if (word == "... | a.cc: In function 'int main()':
a.cc:12:12: error: expected primary-expression before 'int'
12 | a += int n=stoi(S.top());
| ^~~
a.cc:14:12: error: expected primary-expression before 'int'
14 | a += int n=stoi(S.top());
| ^~~
a.cc:20:12: error: expected primary-expres... |
s321671755 | p02263 | C++ | #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;
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.cc: In function 'int main()':
a.cc:39:3: error: 'prirnf' was not declared in this scope; did you mean 'printf'?
39 | prirnf("%d\n", pop());
| ^~~~~~
| printf
|
s009805115 | p02263 | C++ | #include "stack.h"
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
Stack<int>* s = new Stack<int>(200);
char c;
while(cin >> c){
//printf("%c\n",c);
if(isdigit(c)){
s->push(c-48);
}
if(c == '+'){
//fprintf(stderr,"in");
int op1 = s->pop();
//printf(... | a.cc:1:10: fatal error: stack.h: No such file or directory
1 | #include "stack.h"
| ^~~~~~~~~
compilation terminated.
|
s635993366 | p02263 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
template <class T>
class Stack{
//メンバ関数
public:
struct Node{
Node* prev; //前のノードへのポインタ
Node* next; //後のノードへのポインタ
T value; //このノードに格納されているデータ
};
private:
Node* top;
int max;
int element_num;
public:
Stack(int num);
T pop();
void ... | a.cc: In function 'int main()':
a.cc:108:2: error: expected '}' at end of input
108 | }
| ^
a.cc:78:11: note: to match this '{'
78 | int main(){
| ^
|
s593430301 | p02263 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
int main() {
vector<string> ary;
string v;
while (cin >> v)
{
ary.push_back(v);
}
stack<int> stk;
int sum = 0; int v1 = 0; int v2 = 0;
for (int i = 0;i < ary.size();i++) {
string val = ary[i];
if (val == "+... | a.cc: In function 'int main()':
a.cc:9:9: error: 'vector' was not declared in this scope
9 | vector<string> ary;
| ^~~~~~
a.cc:9:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: not... |
s484274265 | p02263 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
using namespace std;
int main() {
std::ifstream in("C:\\Users\\kou\\source\\repos\\AtCoderTest\\Debug\\input.txt");
std::cin.rdbuf(in.rdbuf());
vector<string> ary;
string v;
while (cin >> v)
{
ary.push_back(v);
... | a.cc: In function 'int main()':
a.cc:12:25: error: variable 'std::ifstream in' has initializer but incomplete type
12 | std::ifstream in("C:\\Users\\kou\\source\\repos\\AtCoderTest\\Debug\\input.txt");
| ^
a.cc:6:1: note: 'std::ifstream' is defined in header '<fstream>'; this is... |
s140351729 | p02263 | C++ | #include<iostream>
#include<vector>
using namespace std;
int cnt,l,n;
int A[100];
vector<int> G;
void insertionSort(int A[],int n,int g){
for(int i=g;i<n;i++){
int v=A[i];
int j = i-g;
while(j>=0 && A[j]>v){
A[i + g] =A[i];
j -=g;
cnt++;
}
... | a.cc: In function 'int main()':
a.cc:43:18: error: expected ';' before string constant
43 | if(i)cout" ";
| ^~~
| ;
|
s955593745 | p02263 | C++ | #include <iostream>
#include <cstdlib>
#include <stack>
using namespace std;
stack<int>s;
char ch[11];
int main()
{
while(cin>>ch)
{
if(ch[0] == '+')
{
int a = s.top();
s.pop();
int b = s.top();
s.pop();
s.push(a+b);
... | a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:11:1: note: to match this '{'
11 | {
| ^
|
s088793705 | p02263 | C++ | #include <iostream>
#include <cstdlib>
#include <stack>
using namespace std;
stack<int>s;
string ch;
int main()
{
while(cin>>ch)
{
if(ch[0] == '+')
{
int a = s.top();
s.pop();
int b = s.top();
s.pop();
s.push(a+b);
}... | a.cc: In function 'int main()':
a.cc:39:25: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
39 | s.push(atoi(ch));
| ^~
| |
| std::string {aka std::__cxx11::basic_string... |
s224861727 | p02263 | C++ | #include <iostream>
#include <cstdlib>
#include <stack>
using namespace std;
stack<int>s;
char ch;
int main()
{
while(cin>>ch)
{
if(ch[0] == '+')
{
int a = s.top();
s.pop();
int b = s.top();
s.pop();
s.push(a+b);
}
... | a.cc: In function 'int main()':
a.cc:15:14: error: invalid types 'char[int]' for array subscript
15 | if(ch[0] == '+')
| ^
a.cc:23:19: error: invalid types 'char[int]' for array subscript
23 | else if(ch[0] == '-')
| ^
a.cc:31:19: error: invalid types 'ch... |
s862410110 | p02263 | C++ | #include <iostream>
#include <stack>
#include <list>
#include <boost/algorithm/string.hpp>
using namespace std;
int main() {
string line;
getline(cin, line);
list<string> list_string;
boost::split(list_string, line, boost::is_space());
stack<int> stack;
list<string>::iterator it = list_string.begin();
... | a.cc:4:10: fatal error: boost/algorithm/string.hpp: No such file or directory
4 | #include <boost/algorithm/string.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s243090074 | p02263 | C++ | #include <iostream>
#include <vector>
#include <stack>
#include <string>
#include <cstdlib>
using namespace std;
int main(){
stack<int> s;
string word;
while(cin >> word){
s.push(word)
if(word=="+"){
s.push(s.pop()+s.pop());
}else if(word=="-")
{
s.push(s.pop()-s.pop());
}else i... | a.cc: In function 'int main()':
a.cc:13:11: error: no matching function for call to 'std::stack<int>::push(std::string&)'
13 | s.push(word)
| ~~~~~~^~~~~~
In file included from /usr/include/c++/14/stack:63,
from a.cc:3:
/usr/include/c++/14/bits/stl_stack.h:258:7: note: candidate: 'void... |
s789447148 | p02263 | C++ | #include <iostream>
#include <vector>
#include <stack>
#include <string>
#include <cstdlib>
using namespace std;
int main(){
stack<int> s;
string word;
while(cin >> word){
if(word=="+"){
int x1 = s.top();
s.pop();
int x2 = s.top();
s.pop();
s.push(x1+x2);
}else if(word=="-... | a.cc: In function 'int main()':
a.cc:38:4: error: 'co' was not declared in this scope
38 | co
| ^~
a.cc:38:6: error: expected '}' at end of input
38 | co
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s394409561 | p02263 | C++ | #include <iostream>
#include <string>
#include<cstdlib>
using namespace std;
#define STACK_MAX 1000
int stack[STACK_MAX];
int stack_top = 0;
void push(int val){
if (stack_top==STACK_MAX) {
return;
}else{
stack[stack_top++]=val;
}
}
int pop(){
if (stack_top==0) {
return(0);
... | a.cc: In function 'void culcu(std::string)':
a.cc:41:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'c'
41 | push(atoi(cul.c str()));
| ^
|
s783316167 | p02263 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <stack>
#include <cstdlib>
using namespace std;
int main()
{
stack<int> num;
string s;
int a, b;
while(cin >> s){
if(s >= "0" && s <= "9")
num.push(atoi(s.c_str()));
else if(s == "+" || s == "-" || s == "*" || s == "/"){
a = ... | a.cc: In function 'int main()':
a.cc:31:2: error: expected '}' at end of input
31 | }
| ^
a.cc:10:1: note: to match this '{'
10 | {
| ^
|
s860656142 | p02263 | C++ | /Users/takashishimada/Desktop/情報数理科学演習?/ReversePolishNotation.cc | a.cc:1:1: error: expected unqualified-id before '/' token
1 | /Users/takashishimada/Desktop/情報数理科学演習?/ReversePolishNotation.cc
| ^
|
s274380785 | p02263 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <stack>
#include <cstdlib>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
stack<int> s;
int main() {
char str[8];
while(1) {
if(scanf("%s", str) == EOF) break;
if(!s... | a.cc: In function 'int main()':
a.cc:16:21: error: 'strcmp' was not declared in this scope
16 | if(!strcmp(str,"*")) {
| ^~~~~~
a.cc:7:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <cstdlib>
+++... |
s915335331 | p02263 | C++ | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
int stack[200] = { 0 }, idx = 100;
char input[200],*elem;
gets_s(input);
elem = strtok(input, " ");
while(elem!=NULL){
if (elem[0] == '+'){
stack[idx + 1] += stack[idx++];
}
else if (elem[0] == '-'){
stack[idx + 1] -= stack[idx++]... | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets_s' was not declared in this scope
9 | gets_s(input);
| ^~~~~~
|
s767155538 | p02263 | C++ |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int main(){
int s, sta[MAX], i = 0;
char st[N];
while(scanf("%s", sta) != EOF){
if(sta[0] == '+'){
sta[i - 2] += sta[i - 1];
i -= 1;
}
else if(sta[0] == '-'){
sta[i - 2] -= sta[i - 1];
i--;
... | a.cc: In function 'int main()':
a.cc:10:11: error: 'N' was not declared in this scope
10 | char st[N];
| ^
a.cc:29:16: error: 'st' was not declared in this scope; did you mean 'sta'?
29 | s = atoi(st);
| ^~
| sta
|
s635503599 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
int main(){
std::stack<int> Stack;//スタック
std::string lineloader;//行ローダー
char* ctx;//コンテクスト
//ロード
std::getline(std::cin, lineloader);
char* line = new char[lineloader.size() + 1];
strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
char* tokenloader... | a.cc: In function 'int main()':
a.cc:13:9: error: 'strcpy_s' was not declared in this scope
13 | strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
| ^~~~~~~~
a.cc:14:29: error: 'strtok_s' was not declared in this scope; did you mean 'strtol_l'?
14 | char* tokenloader = strto... |
s343248745 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
#include <stdlib.h>
int main(){
std::stack<int> Stack;//スタック
std::string lineloader;//行ローダー
char* ctx;//コンテクスト
//ロード
std::getline(std::cin, lineloader);
char* line = new char[lineloader.size() + 1];
strcpy_s(line, lineloader.size() + 1, lineloader.c_str())... | a.cc: In function 'int main()':
a.cc:14:9: error: 'strcpy_s' was not declared in this scope
14 | strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
| ^~~~~~~~
a.cc:15:29: error: 'strtok_s' was not declared in this scope; did you mean 'strtol_l'?
15 | char* tokenloader = strto... |
s965992054 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
#include <stdlib.h>
#include <cstring>
int main(){
std::stack<int> Stack;//スタック
std::string lineloader;//行ローダー
char* ctx;//コンテクスト
//ロード
std::getline(std::cin, lineloader);
char* line = new char[lineloader.size() + 1];
strcpy_s(line, lineloader.size() + 1, ... | a.cc: In function 'int main()':
a.cc:15:9: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
15 | strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
| ^~~~~~~~
| strcpy
a.cc:16:29: error: 'strtok_s' was not declared in this scope; did you mean 'strto... |
s900607883 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
#include <stdlib.h>
#include <string.h>
int main(){
std::stack<int> Stack;//スタック
std::string lineloader;//行ローダー
char* ctx;//コンテクスト
//ロード
std::getline(std::cin, lineloader);
char* line = new char[lineloader.size() + 1];
strcpy_s(line, lineloader.size() + 1,... | a.cc: In function 'int main()':
a.cc:15:9: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
15 | strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
| ^~~~~~~~
| strcpy
a.cc:16:29: error: 'strtok_s' was not declared in this scope; did you mean 'strto... |
s342070570 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
#include <string.h>
int main(){
std::stack<int> Stack;//スタック
std::string lineloader;//行ローダー
char* ctx;//コンテクスト
//ロード
std::getline(std::cin, lineloader);
char* line = new char[lineloader.size() + 1];
strcpy_s(line, lineloader.size() + 1, lineloader.c_str())... | a.cc: In function 'int main()':
a.cc:14:9: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
14 | strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
| ^~~~~~~~
| strcpy
a.cc:15:29: error: 'strtok_s' was not declared in this scope; did you mean 'strto... |
s117892001 | p02263 | C++ | #include <iostream>
#include <string>
#include <stack>
#include <stdlib.h>
#include <string.h>
int main(){
std::stack<int> Stack;//スタック
std::string lineloader;//行ローダー
char* ctx;//コンテクスト
//ロード
std::getline(std::cin, lineloader);
char* line = new char[lineloader.size() + 1];
strcpy_s(line, lineloader.size() + 1,... | a.cc: In function 'int main()':
a.cc:15:9: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
15 | strcpy_s(line, lineloader.size() + 1, lineloader.c_str());
| ^~~~~~~~
| strcpy
a.cc:16:29: error: 'strtok_s' was not declared in this scope; did you mean 'strto... |
s006138379 | p02263 | C++ | include <iostream>
#include <string>
#include <stack>
#include <cstdlib>
using namespace std;
int main(void){
string s;
int n1,n2;
stack<int> Q;
while (cin >> s) {
if (s == "+"){
n1 = Q.top();
Q.pop();
n2 = Q.top();
Q.pop();
Q.push(n1+... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a typ... |
s521682624 | p02263 | C++ | #include "stdafx.h"
#include<stack>
#include<iostream>
#include<string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
stack<int>st;
string a;
while(cin >> a){
if(a[0] == '+'){
int b = st.top();
st.pop();
int c = st.top();
st.pop();
st.push(b+c);
}
if(a[0] == '-'){
... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s570503246 | p02263 | C++ | #include "stdafx.h"
#include<stack>
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void)
{
stack<int>st;
string a;
while(cin >> a){
if(a[0] == '+'){
int b = st.top();
st.pop();
int c = st.top();
st.pop();
st.push(b+c);
}else if(a[0] == '-'){
... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s980785020 | p02263 | C++ | #include "stdafx.h"
#include<stack>
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void)
{
stack<int>str;
string a;
while(cin >> str){
if(a[0] == '+'){
int b = st.top();
st.pop();
int c = st.top();
st.pop();
st.push(b+c);
}else if(str[0] == '-')... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s006222603 | p02263 | C++ | #include<stack>
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void)
{
stack<int>str;
string a;
while(cin >> str){
if(str[0] == '+'){
int b = st.top();
st.pop();
int c = st.top();
st.pop();
st.push(b+c);
}else if(str[0] == '-'){
int b = st.to... | a.cc: In function 'int main()':
a.cc:14:19: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::stack<int>')
14 | while(cin >> str){
| ~~~ ^~ ~~~
| | |
| | std::stack<int>
| ... |
s338276811 | p02263 | C++ | #include "stdafx.h"
#include<stack>
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void)
{
stack<int>str;
string a;
int b,c,d,e,f,g;
while(cin >> str){
if(str[0] == '+'){
b = st.top();
st.pop();
c = st.top();
st.pop();
st.push(b+c);
}else if... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s111519163 | p02263 | C++ | #include "stdafx.h"
#include<stack>
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void)
{
stack<int>str;
string a;
int b,c,d,e,f,g;
while(cin >> str){
if(str[0] == '+'){
b = st.top();
st.pop();
c = st.top();
st.pop();
st.push(b+c);
}else if... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s539201038 | p02263 | C++ | #include <iostream>
#include <stack>
using namespace std;
stack<int> S;
int main() {
char s;
int a, b;
while (cin >> s) {
switch (s) {
case '+':
a = S.top(); S.pop();
b = S.top(); S.pop();
S.push(a + b); break;
case '-':
b = S.top(); S.pop();
a = S.top(); S.... | a.cc:32:2: error: stray '#' in program
32 | }#include <iostream>
| ^
a.cc:32:3: error: 'include' does not name a type
32 | }#include <iostream>
| ^~~~~~~
a.cc:35:12: error: redefinition of 'std::stack<int> S'
35 | stack<int> S;
| ^
a.cc:4:12: note: 'std::stack<int> S' previously... |
s322145446 | p02263 | C++ | #include <cstdio>
#include <cstdlib>
template <typename T>
class stack{
T a[101];
unsigned n;
public:
stack():a(),n(0){}
T& top(){return a[n-1];}
void pop(){return a[n--];}
void push(T in){a[n++]=in;}
};
int main(){
stack<int> s;
char buf[100];
while(scanf("%s",buf) != EOF){
int a;
switc... | a.cc: In function 'int main()':
a.cc:22:27: error: void value not ignored as it ought to be
22 | case '+' : a = s.pop(); s.top() += a; break;
| ~~~~~^~
a.cc:23:27: error: void value not ignored as it ought to be
23 | case '-' : a = s.pop(); s.top() -= a; break;
| ... |
s286872580 | p02263 | C++ | #include <cstdio>
#include <cstdlib>
struct stack{
int a[101];
unsigned n;
stack():a(),n(0){}
int& top(){return a[n-1];}
int pop(){return a[--n];}
void push(int in){a[n++]=in;}
};
int main(){
std::ios::sync_with_stdio(false);
stack s;
char buf[100];
while(scanf("%s",buf) != EOF){
int a;
s... | a.cc: In function 'int main()':
a.cc:14:8: error: 'std::ios' has not been declared
14 | std::ios::sync_with_stdio(false);
| ^~~
|
s134873655 | p02263 | C++ | /* last edited at 29/8/2015 by charis
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
class stack{
public:
int top;
int S[];
void initialize(){
top = 0;
}
int isEmpty(){
return top == 0;
}
in... | a.cc: In function 'int main()':
a.cc:89:14: error: 'class stack' has no member named 'size'
89 | while (s.size()) {
| ^~~~
a.cc:90:17: error: 'stk' was not declared in this scope; did you mean 'std'?
90 | cout << stk.pop() << endl;
| ^~~
| ... |
s619664198 | p02263 | C++ | /* last edited at 29/8/2015 by charis
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
class stack{
public:
int top;
int S[];
void initialize(){
top = 0;
}
int isEmpty(){
return top == 0;
}
in... | a.cc: In function 'int main()':
a.cc:69:14: error: 'class stack' has no member named 'size'
69 | while (s.size()) {
| ^~~~
|
s513988593 | p02263 | C++ | 0, 0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 0, 0
| ^
|
s759545439 | p02263 | C++ | while que = gets
que.chomp
stack = []
que = que.split(" ")
while que.size>0
a = que.shift
if a == "+"
x = stack.shift.to_i + stack.shift.to_i
stack.unshift(x)
elsif a == "-"
x = -stack.shift.to_i + stack.shift.to_i
elsif a == "*"
x = stack.shift.... | a.cc:1:1: error: expected unqualified-id before 'while'
1 | while que = gets
| ^~~~~
|
s597251378 | p02263 | C++ | #include <string>
#include <stack>
#include <iostream>
#include <cstdlib>
using naemspace std;
int main () {
string word;
stack<int> S;
while (cin >> word) {
if (word == "+") {
int n = S.top();
S.pop();
n += S.top();
S.pop();
S.push(n);
}
else if (word == "-") {
int... | a.cc:5:7: error: expected nested-name-specifier before 'naemspace'
5 | using naemspace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
7 | string word;
| ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/incl... |
s492775195 | p02263 | C++ | #include <iostream>
#include <stack>
using namespace std;
char expr[10000];
int main() {
stack<long> S;
cin.getline(expr, 10000);
char* s = expr;
for (;;) {
if (*s == '\0') { break; }
if ('0' <= *s && *s <= '9') {
S.push(strtol(s, &s, 10));
if (*s == ' ') { ... | a.cc: In function 'int main()':
a.cc:39:1: error: expected primary-expression before '}' token
39 | }
| ^
a.cc:38:11: error: expected ';' before '}' token
38 | return
| ^
| ;
39 | }
| ~
|
s401124815 | p02263 | C++ | #include <iostream>
#include <stack>
using namespace std;
char expr[10000];
int main() {
stack<long> S;
cin.getline(expr, 10000);
char* s = expr;
for (;;) {
if (*s == '\0') { break; }
if ('0' <= *s && *s <= '9') {
S.push(strtol(s, &s, 10));
if (*s == ' ') { ... | a.cc: In function 'int main()':
a.cc:38:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
38 | return;
| ^~~~~~
|
s093634406 | p02263 | C++ |
int main(){
string word;
stack<int> S;
while(cin >> word){
if(word == "+"){
int m = S.top();
S.pop();
int n = S.top();
S.pop();
S.push(m+n);
}
else if(word == "-"){
int m = S.top();
S.pop();
int n = S.top();
S.pop();
S.push(n-m);
}
e... | a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
3 | string word;
| ^~~~~~
a.cc:4:3: error: 'stack' was not declared in this scope
4 | stack<int> S;
| ^~~~~
a.cc:4:9: error: expected primary-expression before 'int'
4 | stack<int> S;
| ... |
s497642211 | p02263 | C++ | #include <iostream>
using namespace std;
int top, S[1000];
void push(x)
{
S[top++] = x;
}
int pop()
{
top--;
return S[top+1];
}
int main(void)
{
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.cc:6:6: error: variable or field 'push' declared void
6 | void push(x)
| ^~~~
a.cc:6:11: error: 'x' was not declared in this scope
6 | void push(x)
| ^
a.cc: In function 'int main()':
a.cc:30:25: error: 'push' was not declared in this scope
30 | push(a + b... |
s210644682 | p02263 | C++ | #include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <cmath>
#include <functional>
#include <cassert>
#include <iomanip>
#include <array>
#include <time.h>
#include <limits.h>
#include <windows.h>
#pragma comment(lib, "winmm.lib")
#d... | a.cc:15:10: fatal error: windows.h: No such file or directory
15 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s138080211 | p02263 | C++ | #include <cstdio>
#include <string>
#define STACK_MAX_SIZE 1000
int main()
{
using namespace contests;
using namespace std;
int foo, bar;
char tmp[100];
CStack *cs = new CStack;
while (scanf("%s", tmp) != EOF)
{
if (tmp[0] == '+')
{
foo = cs->pop();
bar = cs->pop();
cs->push(foo + bar);
}
el... | a.cc: In function 'int main()':
a.cc:7:25: error: 'contests' is not a namespace-name
7 | using namespace contests;
| ^~~~~~~~
a.cc:12:9: error: 'CStack' was not declared in this scope
12 | CStack *cs = new CStack;
| ^~~~~~
a.cc:12:17: error: 'cs' was no... |
s803689279 | p02263 | C++ | #define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
int main(int argc, const char * argv[]){
... | a.cc: In function 'int main(int, const char**)':
a.cc:16:9: error: declaration of 'operator=' as non-function
16 | int operator = {
| ^~~~~~~~
a.cc:30:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
30 | gets(s);
| ^~~~
| getw
|
s342700904 | p02263 | C++ | #include <stdio.h>
#include <stdlib.h>
int value[100];
int sp = 0;
void push(const int val)
{
value[sp++] = val;
}
int pop()
{
return value[--sp];
}
void operand(const char operand)
{
int ch, val = operand - '0';
while( (ch = getchar()) != ' ' ){
val = val * 10 + (ch - '0');
}
push(... | a.cc:26:14: error: expected type-specifier before '(' token
26 | void operator(const char operator)
| ^
a.cc: In function 'int main()':
a.cc:46:47: error: expected type-specifier before '(' token
46 | case '+': case '-': case '*': operator(ch); break;
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.