submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s554609162 | p02263 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdlib.h> // atoi
using namespace std;
void get_values(vector<int> &values, int &v1, int &v2){
v2 = values.back();
values.pop_back();
v1 = values.back();
values.pop_back();
}
int main(){
// Get Input
string temp;
getline(ci... | a.cc: In function 'int main()':
a.cc:22:29: error: 'istream_iterator' was not declared in this scope
22 | vector<string> calc{istream_iterator<string>{iss},
| ^~~~~~~~~~~~~~~~
a.cc:6:1: note: 'std::istream_iterator' is defined in header '<iterator>'; this is probably fixable... |
s764414377 | p02263 | C++ | #include <iostream>
#include <stack>
#include <string>
#include <cstdlib>
using namespace std;
stack<int> s;
/*
<stack>で使うもの
empty() → コンテナが空かどうかチェック
pop() → 要素を末尾から削除
push() → 要素を末尾に追加
top() → 末尾の要素を取得
size() → 要素数を取得
*/
int calc(string str){
int x = s.top();
s.pop();
int y = s.top();
s.pop(... | a.cc:43:39: error: extended character is not valid in an identifier
43 | s.push(atoi(str.c_str())); //atoiはchar型なので変換する。
| ^
a.cc: In function 'void judge()':
a.cc:43:39: error: '\U00003000' was not declared in this scope
43 | s.push(atoi(str.c... |
s744618800 | p02263 | C++ | #include<iostream>
#include<cstdlib>
#include<stack>
using namespace std;
int main() {
// 標準ライブラリからstackを使用
stack<int> S;
int a, b, x;
string s;
while( cin >> s ) {
if ( s[0] == '+' ) {
b = S.top(); S.pop();
a = S.top(); S.pop();
S.push(a + b);
} else if ( s[0] == '-' ) {
b =... | a.cc: In function 'int main()':
a.cc:26:30: error: expected ';' before '}' token
26 | S.push(atoi(s.c_str()))
| ^
| ;
27 | }
| ~
|
s693382708 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
bool isOp(char& c){
if(c=='+' || c=='-' || c=='*') return true;
return false;
}
int op(int f, int s, char c){
if(c=='+') return f+s;
else if(c=='-') return s-f;
else return f*s;
}
int main(){
stack<int> st;
char c;
while(cin>>c)){
if... | a.cc: In function 'int main()':
a.cc:16:18: error: expected primary-expression before ')' token
16 | while(cin>>c)){
| ^
|
s320080361 | p02263 | C++ | #include<bits/stdc++.h>
using namespace std;
bool isOp(char& c){
if(c=='+' || c=='-' || c=='*') return true;
return false;
}
int op(int f, int s, char c){
if(c=='+') return f+s;
else if(c=='-') return s-f;
else return f*s;
}
int main(){
stack<int> st;
char c;
while(cin>>c)){
if... | a.cc: In function 'int main()':
a.cc:16:18: error: expected primary-expression before ')' token
16 | while(cin>>c)){
| ^
|
s007074979 | p02263 | C++ | #include <iostream>
#include <cstdlib>
#include <string>
#include <stack>
using namespace std;
int main(){
stack<int> S;
int a,b;
string s;
while( cin >> s != EOF){
if(s[0] == '+'){
a = S.top();
S.pop();
b = S.top();
S.pop();
S.push(a + b);
}else if(s[0] == '-'){
a... | a.cc: In function 'int main()':
a.cc:12:19: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'int')
12 | while( cin >> s != EOF){
| ~~~~~~~~ ^~
| |
| std::basic_istream<char>
a.cc:12:19: note: candidate: 'operator!=(int, int)' (... |
s901321796 | p02263 | C++ | #include <iostream>
#include <cstdlib>
#include <string>
#include <stack>
using namespace std;
int main(){
stack<int> S;
int a,b;
string s;
while( cin >> s[0]){
if(s[0] == '+'){
a = S.top();
S.pop();
b = S.top();
S.pop();
S.push(a + b);
}else if(s[0] == '-'){
a = S... | a.cc: In function 'int main()':
a.cc:32:18: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
32 | S.push(stoi(s[0]));
| ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/... |
s837902271 | p02263 | C++ | #include <iostream>
#include <studio.h>
using namespace std;
int top=0;
int const MAX=1000;
int stack[MAX];
bool isEmpty(){
return top==0;
}
bool isFull(){
return top>=MAX-1;
}
void push(int x){
stack[top+1]=x;
top++;
}
int pop(){
top--;
return stack[top+1];
}
int ctoi(const char c){
if... | a.cc:2:10: fatal error: studio.h: No such file or directory
2 | #include <studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s805226909 | p02263 | C++ | using System;
using System.Collections.Generic;
namespace dentaku
{
class Program
{
static void Main(string[] args)
{
Stack<int> s = new Stack<int>();
string f;
int a, b;
while((f=Console.ReadLine())!=null)
{
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:8:26: error: 'string' has not been declared
8 | static void Main(stri... |
s942173646 | p02263 | C++ | // スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>
// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];
void create_stack(void);
int push(int element);
int pop(void);
int main(void)
{
char str[10];
int i = 0, ch, operand_1, o... | a.cc: In function 'int pop()':
a.cc:108:22: error: expected primary-expression before '<' token
108 | if( stack_count =< 0 )
| ^
|
s480927013 | p02263 | C++ | // スタック
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>
// スタック関連の定義
const int Max_Stack = 1000;
int stack_count = 0;
int ary_stack[Max_Stack];
void create_stack(void);
int push(int element);
int pop(void);
int main(void)
{
char str[10];
int i = 0, ch, operand_1, o... | a.cc: In function 'int pop()':
a.cc:108:22: error: expected primary-expression before '<' token
108 | if( stack_count =< 0 )
| ^
|
s926782406 | p02263 | C++ | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
class Stack
{
public:
void push(int x)
{
++myTop;
myData[myTop] = x;
}
void pop()
{
--myTop;
}
int top()
{
int nTemp = myData[myTop];
return nTemp;
}
private:
int myTop = 0;
int myData[1000] = { 0 };
};
int main()
{
char chIn[100] = { '... | a.cc: In function 'int main()':
a.cc:35:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
35 | while (scanf_s("%s", chIn, 100))
| ^~~~~~~
| scanf
|
s027587721 | p02263 | C++ | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int myTop = 0;
int myData[1000] = { 0 };
void push(int x)
{
++myTop;
myData[myTop] = x;
}
void pop()
{
--myTop;
}
int top()
{
int nTemp = myData[myTop];
return nTemp;
}
int main()
{
char chIn[100] = { '\0' };
int nTemp = 0;
int na = 0, nb = 0;
while... | a.cc: In function 'int main()':
a.cc:28:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
28 | while (scanf_s("%s", chIn, 100))
| ^~~~~~~
| scanf
|
s506045254 | p02263 | C++ |
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
class Stack {
public:
Stack(int n) : s_(n), top_(0){};
bool isEmpty() { return top_ == 0; }
bool isFull() { return top_ == s_.size(); }
void push(int x) {
if (isFull()) {
return;
}
to... | a.cc: In function 'int main()':
a.cc:42:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
42 | while (scanf_s("%s", s, 1000) != EOF) {
| ^~~~~~~
| scanf
|
s860286010 | p02263 | C++ | /*
* ALDS1_3_A.cpp
*
* Created on: Apr 25, 2018
* Author: 13743
*/
#include<cstdio>
#include<stack>
#include<cstdlib>
using namespace std;
int main() {
stack<int> st;
char s[100];
while(scanf("%s", s) != EOF) {
if(s[0] == '+') {
int a = st.pop();
int b = st.pop();
st.push(a+b);
}
else if... | a.cc: In function 'int main()':
a.cc:19:39: error: void value not ignored as it ought to be
19 | int a = st.pop();
| ~~~~~~^~
a.cc:20:39: error: void value not ignored as it ought to be
20 | int b = st.pop();
| ... |
s586270100 | 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
| |
s964510851 | p02263 | C++ | #include <bits/stdc++h>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LL long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"... | a.cc:1:10: fatal error: bits/stdc++h: No such file or directory
1 | #include <bits/stdc++h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s852471616 | p02263 | C++ | #include<iostream>
#include<string>
int main(){
std::string str;
int stack[101];
int count=-1;
while(std::cin >> str){
count++;
if(str=="+"){
stack[count-2]=stack[count-2]+stack[count-1];
stack[count]=0;
stack[count-1]=0;
count=count-2;
}else if(str=="-"){
stack[count-2]=stack[count-2]-stac... | a.cc: In function 'int main()':
a.cc:30:48: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
30 | stack[count]=std::atoi(str);
| ^~~
| |
... |
s303604586 | p02263 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<stdlib>
int main(){
std::string str;
int stack[101];
int count=-1;
while(std::cin >> str){
count++;
if(str=="+"){
stack[count-2]=stack[count-2]+stack[count-1];
stack[count]=0;
stack[count-1]=0;
count=count-2;
}else if(str=="-"){
... | a.cc:4:9: fatal error: stdlib: No such file or directory
4 | #include<stdlib>
| ^~~~~~~~
compilation terminated.
|
s993378576 | p02263 | C++ | l=list(input().split()) ##文字も数字も入る
stack=[]
for x in l: ##リストの長さ文だけ繰り返し
if x in ['+','-','*']: ##←知らなかった判定方法
t=str(stack.pop()) ##末尾取り出し
r=str(stack.pop())
c=r+x+t
stack+=[int(eval(c))] ##eval:入力した式の入力
else:
stack+=[int(x)] ##[]の意味?>リストに追加
print(stack.pop())
| a.cc:1:26: error: stray '##' in program
1 | l=list(input().split()) ##文字も数字も入る
| ^~
a.cc:4:13: error: stray '##' in program
4 | for x in l: ##リストの長さ文だけ繰り返し
| ^~
a.cc:5:28: error: stray '##' in program
5 | if x in ['+','-','*']: ##←知らなかった判定方法
| ... |
s298567504 | p02263 | C++ | #include <cstdio>
#include <stack>
using namespace std;
void calculate(stack<int> &st, char c) {
int b = st.top();
st.pop();
int a = st.top();
st.pop();
switch (c) {
case '+':
st.push(a + b);
break;
case '-':
st.push(a - b);
break;
... | a.cc: In function 'int main()':
a.cc:32:21: error: 'atoi' was not declared in this scope
32 | st.push(atoi(s));
| ^~~~
|
s264645821 | p02263 | C++ | #include <cstdio>
#include <stack>
using namespace std;
void calculate(stack<int> &st, char c) {
int b = st.top();
st.pop();
int a = st.top();
st.pop();
switch (c) {
case '+':
st.push(a + b);
break;
case '-':
st.push(a - b);
break;
... | a.cc: In function 'int main()':
a.cc:31:21: error: 'atoi' was not declared in this scope
31 | st.push(atoi(s));
| ^~~~
|
s152193373 | p02263 | C++ | class Stack:
def __init__(self, full_idx=10):
self.stack = [None] * full_idx
self.top = 0
self.MAX = full_idx
def is_empty(self):
return self.top == 0
def is_full(self):
return self.top >= self.MAX - 1
def push(self, x):
if self.is_full():
r... | a.cc:48:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
48 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:2:9: error: expected class-name before '__init__'
2 | def __init__(self, full_idx=10):
| ^~~~~~~~
a.cc:2:9: error: expected '{' bef... |
s340547871 | p02263 | C++ | #include<iostream>
#include<vector>
#include<ctype>
#include<algorithm>
using namespase std;
String st;
vector<String> not_num[99];
int<int> num[100];
for(int i=0; i<200; i++){
st = cin;
if( all_of(string.cbegin(), string.cend(), isdigit() ){
num.push_back( int(st) );
}else{
not_num = st;
size = num_size;... | a.cc:3:9: fatal error: ctype: No such file or directory
3 | #include<ctype>
| ^~~~~~~
compilation terminated.
|
s456026004 | p02263 | C++ | #include<iostream>
#include<vector>
#include<ctype>
#include<algorithm>
using namespase std;
String st;
vector<String> not_num[99];
vector<int> num[100];
for(int i=0; i<200; i++){
st = cin;
if( all_of(string.cbegin(), string.cend(), isdigit() ){
num.push_back( stoi(st) );
}else{
not_num = st;
size = num_s... | a.cc:3:9: fatal error: ctype: No such file or directory
3 | #include<ctype>
| ^~~~~~~
compilation terminated.
|
s629055530 | p02263 | C++ | #include<iostream>
#include<cstdlib>
#include<vector>
#include<string>
void push(int n,std::vector<int>& Stack){
Stack.push_back(n);
}
int pop(std::vector<int>& Stack){
int top=Stack.size();
int x;
x=Stack[top];
Stack.pop_back();
return x;
}
int main(){
int x,y;
std::vector<int> Stack;
std::strin... | a.cc: In function 'int main()':
a.cc:39:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
39 | push(std::atoi(c),Stack);
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
... |
s372174148 | p02263 | C++ | #include<iostream>
#include<cstdlib>
#include<vector>
#include<string>
void push(int n,std::vector<int>& Stack){
Stack.push_back(n);
}
int pop(std::vector<int>& Stack){
int top=Stack.size();
int x;
x=Stack[top];
Stack.pop_back();
return x;
}
int main(){
int x,y;
std::vector<int> Stack;
std::strin... | a.cc: In function 'int main()':
a.cc:39:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
39 | push(std::atoi(c),Stack);
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
... |
s883876208 | p02263 | C++ | #include <iostream>
#include <cstdlib>
using namespace std;
static string tasu = "+";
static string hiku = "-";
static string kakeru = "*";
int top = 0;
int S[200];
void push(int x) {
S[++top] = x;
}
int usiro() {
return S[top--];
}
int main () {
string s;
while (cin >> s) {
if (s == t... | a.cc: In function 'int main()':
a.cc:39:13: error: 'pop' was not declared in this scope; did you mean 'top'?
39 | cout << pop() << endl;
| ^~~
| top
|
s986914016 | p02263 | C++ | #include <iostream>
#include <cstdlib>
using namespace std;
static string tasu = "+";
static string hiku = "-";
static string kakeru = "*";
int top = 0;
int S[200];
void push(int x) {
S[++top] = x;
}
int usiro() {
return S[top--];
}
int main () {
string s;
while (cin >> s) {
if (s == t... | a.cc: In function 'int main()':
a.cc:41:14: error: expected '}' at end of input
41 | return 0;
| ^
a.cc:20:13: note: to match this '{'
20 | int main () {
| ^
|
s925524545 | p02263 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
int a[100] = { 0 };
int i = 0;
string str;
while (getline(cin,str)) {
if (i > 1) {
if (str == "+") {
a[i - 2] = a[i - 2] + a[i - 1];
i = i - 1;
}
else if (str == "-") {
a[i - 2] = a[i - 2] - a[i - 1];
i = i - 1;
}
... | a.cc: In function 'int main()':
a.cc:35:14: error: expected '}' at end of input
35 | return 0;
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s816578392 | 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;
| ... |
s852796897 | 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');
}
p... | 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;
| ... |
s069442091 | p02263 | C++ | #include<iostream>
#include<string>
#include<vector>
struct Stack{
std::vector<int> nums;
int stackn,nmax;
};
void push(int a,Stack &s){
if(s.stackn<=s.nmax){
s.nums[s.stackn++]=a;
}else{
s.nums.push_back(a);
s.stackn++;
s.ptrn++;
}
}
int pop(Stack &s){
s.st... | a.cc: In function 'void push(int, Stack&)':
a.cc:16:11: error: 'struct Stack' has no member named 'ptrn'
16 | s.ptrn++;
| ^~~~
a.cc: In function 'int pop(Stack&)':
a.cc:22:21: error: 'struct Stack' has no member named 'stack_ptr'
22 | return s.nums[s.stack_ptr];
| ... |
s215478908 | p02263 | C++ | #include<iostream>
#include<string>
#include<vector>
struct Stack{
std::vector<int> nums;
int stackn,nmax;
};
void push(int a,Stack &s){
if(s.stackn<=s.nmax){
s.nums[s.stackn++]=a;
}else{
s.nums.push_back(a);
s.stackn++;
s.ptrn++;
}
}
int pop(Stack &s){
s.st... | a.cc: In function 'void push(int, Stack&)':
a.cc:16:11: error: 'struct Stack' has no member named 'ptrn'
16 | s.ptrn++;
| ^~~~
a.cc: In function 'int pop(Stack&)':
a.cc:22:21: error: 'struct Stack' has no member named 'stack_ptr'
22 | return s.nums[s.stack_ptr];
| ... |
s783958988 | p02263 | C++ | #include<iostream>
#include<string>
#include<vector>
struct Stack{
std::vector<int> nums;
int stackn,nmax;
};
void push(int a,Stack &s){
if(s.stackn<=s.nmax){
s.nums[s.stackn++]=a;
}else{
s.nums.push_back(a);
s.stackn++;
s.nmax++;
}
}
int pop(Stack &s){
s.st... | a.cc: In function 'int pop(Stack&)':
a.cc:22:21: error: 'struct Stack' has no member named 'stack_ptr'
22 | return s.nums[s.stack_ptr];
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:39:26: error: 'ch' was not declared in this scope
39 | int x=0,size=ch.size();
| ... |
s391681923 | p02263 | C++ | #include<iostream>
#include<string>
#include<vector>
struct Stack{
std::vector<int> nums;
int stackn,nmax;
};
void push(int a,Stack &s){
if(s.stackn<=s.nmax){
s.nums[s.stackn++]=a;
}else{
s.nums.push_back(a);
s.stackn++;
s.nmax++;
}
}
int pop(Stack &s){
s.st... | a.cc: In function 'int main()':
a.cc:39:26: error: 'ch' was not declared in this scope
39 | int x=0,size=ch.size();
| ^~
|
s836250453 | p02263 | C++ | //16D8103012G 三品海渡 C++ momora347
#include "stdafx.h"
#include<iostream>
using namespace std;
#include<iostream>
#include<string>
#include<vector>
struct Stack {
std::vector<int> nums;
int stackn, nmax;
};
void push(int a, Stack &s) {
if (s.stackn <= s.nmax) {
s.nums[s.stackn++] = a;
}
else {
s.nums.push_back... | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s780932108 | p02263 | C++ | #include<iostream>
using namespace std;
#include<string>
#include<vector>
struct Stack {
std::vector<int> nums;
int stackn, nmax;
};
void push(int a, Stack &s) {
if (s.stackn <= s.nmax) {
s.nums[s.stackn++] = a;
}
else {
s.nums.push_back(a);
s.stackn++;
s.nmax++;
}
}
int pop(Stack &s) {
s.stackn--;
r... | a.cc: In function 'int main()':
a.cc:53:18: error: expected '}' at end of input
53 | return 0;
| ^
a.cc:27:12: note: to match this '{'
27 | int main() {
| ^
|
s725828273 | p02263 | C++ | #include<iostream>
#include<stdlib.h>
#include<stack>
#include<string>
int stpop(){
int x;
x=s.top();
s.pop()
return x;
}
int main(){
int a,b;
stack<int> s;
string st;
while(cin>>st){
if(c[0]=='+'){
a=stpop();
b=stpop();
s.push(a+b);
... | a.cc: In function 'int stpop()':
a.cc:8:7: error: 's' was not declared in this scope
8 | x=s.top();
| ^
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
11 | }
| ^
a.cc: In function 'int main()':
a.cc:15:5: error: 'stack' was not declared in this scope;... |
s551730394 | p02263 | C++ | #include<iostream>
#include<stdlib.h>
#include<stack>
#include<string>
int stpop(){
int x;
x=s.top();
s.pop()
return x;
}
int main(){
int a,b;
stack<int> s;
string st;
while(cin>>st){
if(c[0]=='+'){
a=stpop();
b=stpop();
s.push(a+b);
... | a.cc: In function 'int stpop()':
a.cc:8:7: error: 's' was not declared in this scope
8 | x=s.top();
| ^
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
11 | }
| ^
a.cc: In function 'int main()':
a.cc:15:5: error: 'stack' was not declared in this scope;... |
s619408900 | p02263 | C++ | #include<iostream>
#include<stdlib.h>
#include<stack>
#include<string>
int stpop(){
int x;
x=s.top();
s.pop()
return x;
}
int main(){
int a,b;
stack<int> s;
string st;
while(cin>>st){
if(st[0]=='+'){
a=stpop();
b=stpop();
s.push(a+b);
... | a.cc: In function 'int stpop()':
a.cc:8:7: error: 's' was not declared in this scope
8 | x=s.top();
| ^
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
11 | }
| ^
a.cc: In function 'int main()':
a.cc:15:5: error: 'stack' was not declared in this scope;... |
s812770677 | p02263 | C++ | #include<iostream>
#include<stdlib.h>
#include<stack>
#include<string>
int stpop(stack<int> s){
int x;
x=s.top();
s.pop()
return x;
}
int main(){
int a,b;
stack<int> s;
string st;
while(cin>>st){
if(st[0]=='+'){
a=stpop(s);
b=stpop(s);
s.push... | a.cc:6:11: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
6 | int stpop(stack<int> s){
| ^~~~~
| std::stack
In file included from /usr/include/c++/14/stack:63,
from a.cc:3:
/usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std::stack' decl... |
s500311455 | p02263 | C++ | #include<iostream>
#include<stdlib.h>
#include<stack>
#include<string>
int main(){
int a,b;
stack<int> s;
string st;
while(cin>>st){
if(st[0]=='+'){
a=s.top();
s.pop()
b=s.top();
s.pop();
s.push(a+b);
}else if(st[0]=='*'){
... | a.cc: In function 'int main()':
a.cc:9:5: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
9 | stack<int> s;
| ^~~~~
| std::stack
In file included from /usr/include/c++/14/stack:63,
from a.cc:3:
/usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std:... |
s915804740 | p02263 | C++ | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<stack>
#include<string>
int main(){
int a,b;
stack<int> s;
string st;
while(cin>>st){
if(st[0]=='+'){
a=s.top();
s.pop()
b=s.top();
s.pop();
s.push(a+b);
}else i... | a.cc: In function 'int main()':
a.cc:10:5: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
10 | 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... |
s977256089 | p02263 | C++ | #include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
typedef long long ll;
const int MAXN = 200;
int top = 0;
int S[MAXN];
void initialize() {
top = 0;
}
bool isEmpty() {
if (top... | a.cc: In function 'int main()':
a.cc:62:37: 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>]'
62 | push(atoi(s.c_str));
... |
s264849209 | p02263 | C++ | #include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
typedef long long ll;
const int MAXN = 200;
int top = 0;
int S[MAXN];
void initialize() {
top = 0;
}
bool isEmpty() {
if (top == 0)return true;
... | a.cc: In function 'int main()':
a.cc:62:37: 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>]'
62 | push(atoi(s.c_str));
... |
s938779274 | p02263 | C++ | #include <iostream>
#include <sstream>
#include <cstdlib>
using namespace std;
int main() {
string op;
stack<int> st;
int sec,fir;
while(cin >> op){
if(op=="+"||op=="-"||op=="*"){
fir = st.top();
st.pop();
sec = st.top();
st.pop();
if(op=="+") st.push(fir+sec);
if(... | a.cc: In function 'int main()':
a.cc:11:3: error: 'stack' was not declared in this scope
11 | stack<int> st;
| ^~~~~
a.cc:4:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
3 | #include <cstdlib>
+++ |+#include <stack>
4 |
a.cc:11:9: err... |
s285727469 | p02263 | C++ | #include<iostream>
#include<stack>
int main() {
stack<int> S;
for (string s; cin >> s&&s != "$";) {
int a, b;
switch (s[0]) {
case '+':
b = S.top(); S.pop();
a = S.top(); S.pop();
S.push(a + b);
break;
case '-':
b = S.t... | a.cc: In function 'int main()':
a.cc:5:5: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
5 | stack<int> S;
| ^~~~~
| std::stack
In file included from /usr/include/c++/14/stack:63,
from a.cc:2:
/usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std:... |
s157394214 | p02263 | C++ | #include<iostream>
#include<stack>
int main() {
stack<int> S;
for (string s; cin >> s&&s != "$";) {
int a, b;
switch (s[0]) {
case '+':
b = S.top(); S.pop();
a = S.top(); S.pop();
S.push(a + b);
break;
case '-':
b = S.t... | a.cc: In function 'int main()':
a.cc:5:5: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
5 | stack<int> S;
| ^~~~~
| std::stack
In file included from /usr/include/c++/14/stack:63,
from a.cc:2:
/usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std:... |
s570851237 | p02263 | C++ | #include<iostream>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
stack<int> S;
char c[10];
int x,y;
while((cin("%s",&c))!=EOF){
if(c[0]=='+'){
x=S.top();S.pop();
y=S.top();S.pop();
S.push(x+y);
}
else if(c[0]=='-'){
x=S.top();S.pop()... | a.cc: In function 'int main()':
a.cc:12:13: error: no match for call to '(std::istream {aka std::basic_istream<char>}) (const char [3], char (*)[10])'
12 | while((cin("%s",&c))!=EOF){
| ~~~^~~~~~~~~
|
s265963319 | p02263 | C++ | #include<iostream>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
stack<int> S;
char c[10];
int x,y;
while((cin<<("%s",&c))!=EOF){
if(c[0]=='+'){
x=S.top();S.pop();
y=S.top();S.pop();
S.push(x+y);
}
else if(c[0]=='-'){
x=S.top();S.pop... | a.cc: In function 'int main()':
a.cc:12:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'char (*)[10]')
12 | while((cin<<("%s",&c))!=EOF){
| ~~~^~~~~~~~~~~
| | |
| | char (*)[10]
| ... |
s224034943 | p02263 | C++ | #include<iostream>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
stack<int> S;
char c[10];
int x,y;
while((cin)!=EOF){
if(c[0]=='+'){
x=S.top();S.pop();
y=S.top();S.pop();
S.push(x+y);
}
else if(c[0]=='-'){
x=S.top();S.pop();
y... | a.cc: In function 'int main()':
a.cc:12:14: error: no match for 'operator!=' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
12 | while((cin)!=EOF){
| ~~~~~^~
| |
| std::istream {aka std::basic_istream<char>}
a.cc:12:14: note: candidate: 'op... |
s119097099 | p02263 | C++ | #include<iostream>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
stack<int> S;
char c[10];
int x,y;
while((cin>>(c))!=EOF){
if(c[0]=='+'){
x=S.top();S.pop();
y=S.top();S.pop();
S.push(x+y);
}
else if(c[0]=='-'){
x=S.top();S.pop();
... | a.cc: In function 'int main()':
a.cc:12:19: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'int')
12 | while((cin>>(c))!=EOF){
| ~~~~~~~~~~^~
| |
| std::basic_istream<char>
a.cc:12:19: note: candidate: 'operator!=(int, int)' (bui... |
s527391167 | p02263 | C++ | #include<iostream>
#include<stack>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
stack<int> S;
char c[10];
int x,y;
while((cin>>)!=EOF){
if(c[0]=='+'){
x=S.top();S.pop();
y=S.top();S.pop();
S.push(x+y);
}
else if(c[0]=='-'){
x=S.top();S.pop();
... | a.cc: In function 'int main()':
a.cc:12:15: error: expected primary-expression before ')' token
12 | while((cin>>)!=EOF){
| ^
|
s657431906 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
using namespace std;
bool stackDigit(string s){
return (all_of(s.cbegin(), s.cend(), isdigit));
}
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(stackDigit(s)){
st.push(stoi(s));
}else{
... | a.cc: In function 'bool stackDigit(std::string)':
a.cc:9:19: 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>)'
9 | return (all_of(s.cbegin(), s.cend(), isdigit));
| ... |
s628101599 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
#include<cctype>
using namespace std;
bool stackDigit(string s){
return (all_of(s.cbegin(), s.cend(), isdigit));
}
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(stackDigit(s)){
st.push(stoi(s));
... | a.cc: In function 'bool stackDigit(std::string)':
a.cc:10:19: 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>)'
10 | return (all_of(s.cbegin(), s.cend(), isdigit));
| ... |
s192320277 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
#include<cctype>
using namespace std;
bool stackDigit(string s){
return (all_of(s.begin(), s.end(), isdigit));
}
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(stackDigit(s)){
st.push(stoi(s));
... | a.cc: In function 'bool stackDigit(std::string)':
a.cc:10:19: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
10 | return (all_of(s.begin(), s.end(), isdigit));
| ~~~~... |
s289784480 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
#include<cctype>
using namespace std;
bool stackDigit(string s){
return (all_of(s.begin(), s.end(), isdigit));
}
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(stackDigit(s)){
st.push(stoi(s));
... | a.cc: In function 'bool stackDigit(std::string)':
a.cc:10:19: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
10 | return (all_of(s.begin(), s.end(), isdigit));
| ~~~~... |
s904223419 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
#include<cctype>
using namespace std;
bool stackDigit(string s){
return (std::all_of(s.begin(), s.end(), isdigit));
}
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(stackDigit(s)){
st.push(stoi(s));
... | a.cc: In function 'bool stackDigit(std::string)':
a.cc:10:24: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
10 | return (std::all_of(s.begin(), s.end(), isdigit));
| ... |
s933559527 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
#include<cctype>
using namespace std;
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(all_of(s.begin(), s.end(), isdigit)){
st.push(stoi(s));
}else{
i1 = st.top();
st.pop();
... | a.cc: In function 'int main()':
a.cc:14:18: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
14 | if(all_of(s.begin(), s.end(), isdigit)){
| ~~~~~~^~~~~~~~~~~~~~~~~~... |
s737212598 | p02263 | C++ | #include<iostream>
#include<stack>
#include<algorithm>
using namespace std;
int main(){
string s;
int i1, i2;
stack<int> st;
while(cin >>s){
if(all_of(s.begin(), s.end(), isdigit)){
st.push(stoi(s));
}else{
i1 = st.top();
st.pop();
i2 = ... | a.cc: In function 'int main()':
a.cc:13:18: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
13 | if(all_of(s.begin(), s.end(), isdigit)){
| ~~~~~~^~~~~~~~~~~~~~~~~~... |
s488661507 | p02263 | C++ | #include<iostream>
#include<string>
#include<stack>
#include<cstdlib>
#include<cstdio>
using namespace std;
stack<int> st;
int solve(string);
int main(){
string str;
while(cin >>str){
if(str == "+" || str == "-" || str == "*" || str == "/")
st.push(solve(str));
else st.push(atoi(st... | a.cc: In function 'int solve(std::string)':
a.cc:26:9: error: redeclaration of 'int b'
26 | int b = st.top(); st.pop();
| ^
a.cc:25:9: note: 'int b' previously declared here
25 | int b = st.top(); st.pop();
| ^
a.cc:27:24: error: 'a' was not declared in this scope
27 | i... |
s581010421 | p02263 | C++ | package main
import (
"bufio"
"fmt"
"os"
"strings"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
type Stack struct {
s [10000]int
top int
}
func GenStack() Stack {
return Stack{top: 0}
}
func (stack *Stack) Push(value int) {
stack.top++
stack.s[stack.top] = value
}
func (stack *Stack) Pop() int {
v :... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:18:1: error: 'func' does not name a type
18 | func GenStack() Stack {
| ^~~~
a.cc:22:6: error: expected constructor, destructor, or type conversion before '(' token
22 | func (stack *Stack) Push(value int) {
| ... |
s106118076 | p02263 | C++ | package main
import (
"bufio"
"fmt"
"os"
"strings"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
type Stack struct {
s [10000]int
top int
}
func GenStack() Stack {
return Stack{top: 0}
}
func (stack *Stack) Push(value int) {
stack.top++
stack.s[stack.top] = value
}
func (stack *Stack) Pop() int {
v :... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:18:1: error: 'func' does not name a type
18 | func GenStack() Stack {
| ^~~~
a.cc:22:6: error: expected constructor, destructor, or type conversion before '(' token
22 | func (stack *Stack) Push(value int) {
| ... |
s680791421 | p02263 | C++ | #include <iostream>
#include <cstring>
#include <stack>
using namespace std;
int main(int argc, char *argv[]) {
stack<int> S;
string word;
while(cin << word){
if(word == "+"){
int x = S.top();
S.pop();
int y = S.top();
S.pop();
S.push(x+y);
}else if(word == "-"){
int x = S.top();
S.pop();
... | a.cc: In function 'int main(int, char**)':
a.cc:10:19: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
10 | while(cin << word){
| ~~~ ^~ ~~~~
| | |
... |
s075262703 | p02263 | C++ | #include<cstdio>
#include<string.h>
#include<stack>
using namespace std;
stack<int> s1;
stack<char> s2;
int main(){
char ch[300];
gets(ch);
int len=strlen(ch);
int num=0;
int m=10;
for(int i=0;i<len;i++){
if(ch[i]>='0'&&ch[i]<='9'){
if(num==0){
num=ch[i]-'0';
}else if(num/m==0){
num=m*num+(ch[i]-... | a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(ch);
| ^~~~
| getw
|
s718202386 | p02263 | C++ | #include<stdio.h>
#include<string.h>
#include<stack>
using namespace std;
stack<int> s1;
stack<char> s2;
int main(){
char ch[300];
gets(ch);
int len=strlen(ch);
int num=0;
int m=10;
for(int i=0;i<len;i++){
if(ch[i]>='0'&&ch[i]<='9'){
if(num==0){
num=ch[i]-'0';
}else if(num/m==0){
num=m*num+(ch[i]... | a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(ch);
| ^~~~
| getw
|
s461957265 | p02263 | C++ | #include<cstdlib>
#include<iostream>
#include<sstream>
#include<stack>
using namespace std;
int main(){
int a, b;
stack<int> st;
string s;
getline(cin,s);
stringstream ss;
ss << s;
while( ss >> s ) { // 1 2 -
if(s=="+"){
a = st.pop();
b = st.pop();
... | a.cc: In function 'int main()':
a.cc:16:23: error: void value not ignored as it ought to be
16 | a = st.pop();
| ~~~~~~^~
a.cc:17:23: error: void value not ignored as it ought to be
17 | b = st.pop();
| ~~~~~~^~
a.cc:20:23: error: void value not ... |
s376252301 | p02263 | C++ | #include<iostream>
#include<stack>
#include<cstdlib>
using namespace std;
int imain(){
stack<int> S;
int a,b,x;
string s;
while(cin>>s){
cout << s[0] << endl;
if (s[0] == '+'){
a = S.top(); S.pop();
b = S.top(); S.pop();
S.push(a+b);
}else if... | /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
|
s486749242 | p02263 | C++ | class Stack:
def __init__(self, n):
self.n = n
self._l = [None for _ in range(self.n + 1)]
self._top = 0
def push(self, x):
if self.isFull():
raise IndexError("stack is full")
else:
self._top += 1
self._l[self._top] = x
def pop(se... | a.cc:38:18: error: empty character constant
38 | sn = ''
| ^~
a.cc:58:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
58 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:2:9: error: expected class-name before '__init__'
... |
s351978469 | 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--;
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();
pu... | a.cc: In function 'int main()':
a.cc:22:23: error: expected primary-expression before ')' token
22 | if ( s[0] == '+') ) {
| ^
a.cc:35:20: error: expected ';' before '}' token
35 | push(atoi(s))
| ^
| ;
36 | }
| ... |
s866598056 | 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--;
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();
pus... | a.cc: In function 'int main()':
a.cc:35:20: error: expected ';' before '}' token
35 | push(atoi(s))
| ^
| ;
36 | }
| ~
|
s493485802 | p02263 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
map <int ,int> mpa,mpb;
int top, S[1000];
void push(int x){
S[++top]=x;
}
int pop(){
top--;
return S[top... | a.cc: In function 'int main()':
a.cc:46:20: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
46 | push(atoi(s[0]));
| ~~~^
| |
| char
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/inc... |
s374461938 | 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){
if(isFull())
return;
S[sp++] = d;
}
int top(){
... | a.cc:57:32: error: stray '#' in program
57 | tmp2 = s.top();s.pop();#include<iostream>
| ^
a.cc: In function 'int main()':
a.cc:57:33: error: 'include' was not declared in this scope
57 | tmp2 = s.top();s.pop();#include<iostream>
| ... |
s015745646 | p02263 | C++ | javascript:void(0)#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(... | a.cc:1:19: error: stray '#' in program
1 | javascript:void(0)#include<iostream>
| ^
a.cc:1:1: error: 'javascript' does not name a type
1 | javascript:void(0)#include<iostream>
| ^~~~~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/i... |
s451794032 | p02263 | C++ | #include<iostream>
#include<stack>
using namespace std;
typedef long long ll;
ll calc(ll x, 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;
stack<int> S;
while(cin >> str) {
if(str == "+" || str == "-" || s... | a.cc: In function 'int main()':
a.cc:32:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void')
32 | cout << S.pop() << endl;
| ~~~~ ^~ ~~~~~~~
| | |
| | void
| std::ostream {aka std::basic_ostream<char... |
s454338234 | p02263 | C++ | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
class Stack{
private:
int s;
int S[100];
public:
Stack(){
s=0;
}
bool isFull(){
return (s==100);
}
bool isEmpty(){
return (s==0);
}
void push(int d){
if(isFull()){
return;
}
S[s++] = d;
}
void... | a.cc: In function 'int main()':
a.cc:66:9: error: 's' was not declared in this scope; did you mean 'is'?
66 | s.pop();
| ^
| is
|
s259090670 | 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();
... | a.cc: In function 'int main()':
a.cc:21:29: error: expected primary-expression before '=' token
21 | while (scanf("%s", s) !== EOF) {
| ^
|
s470413793 | p02263 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <stack>
using namespace std;
stack<int> S;
int
int main() {
int a, b;
while (scanf("%s", s) != EOF) {
if (s[0] == '+') {
a = S.pop();
b = S.pop();
S.push(a+b);
} else if (s[0] == '-') {
b = S... | a.cc:8:1: error: two or more data types in declaration of 'main'
8 | int
| ^~~
|
s800444566 | p02263 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <stack>
using namespace std;
stack<int> S;
int main() {
int a, b;
while (scanf("%s", s) != EOF) {
if (s[0] == '+') {
a = S.pop();
b = S.pop();
S.push(a+b);
} else if (s[0] == '-') {
b = S.pop();
... | a.cc: In function 'int main()':
a.cc:10:24: error: 's' was not declared in this scope
10 | while (scanf("%s", s) != EOF) {
| ^
a.cc:12:22: error: void value not ignored as it ought to be
12 | a = S.pop();
| ~~~~~^~
a.cc:13:22: error: void value no... |
s494843187 | p02263 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <stack>
using namespace std;
stack<int> S;
int main() {
int a, b;
char s[100];
while (scanf("%s", s) != EOF) {
if (s[0] == '+') {
a = S.pop();
b = S.pop();
S.push(a+b);
} else if (s[0] == '-') {
... | a.cc: In function 'int main()':
a.cc:14:22: error: void value not ignored as it ought to be
14 | a = S.pop();
| ~~~~~^~
a.cc:15:22: error: void value not ignored as it ought to be
15 | b = S.pop();
| ~~~~~^~
a.cc:18:22: error: void value not igno... |
s899808441 | p02263 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <stack>
using namespace std;
int main() {
int a, b;
char s[100];
stack<int> S;
while (scanf("%s", s) != EOF) {
if (s[0] == '+') {
a = S.top(); S.pop();
b = S.top(); S.pop();
S.push(a+b);
} else if (... | a.cc: In function 'int main()':
a.cc:29:23: error: invalid use of void expression
29 | printf("%d", S.pop());
| ~~~~~^~
|
s389506914 | p02263 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(... | a.cc:32:11: error: invalid use of non-static data member 'Stack::MAX'
32 | int v[MAX];
| ^~~
a.cc:31:9: note: declared here
31 | int MAX = 1000;
| ^~~
a.cc:56:2: error: expected ';' after struct definition
56 | }
| ^
| ;
a.cc: In member function 'void Stack::... |
s283620098 | p02263 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(... | a.cc:32:11: error: invalid use of non-static data member 'Stack::MAX'
32 | int v[MAX];
| ^~~
a.cc:31:9: note: declared here
31 | int MAX = 1000;
| ^~~
a.cc: In member function 'void Stack::push(int)':
a.cc:46:13: error: 'v' was not declared in this scope
46 | v... |
s205055628 | p02263 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(... | a.cc:31:16: error: ISO C++ forbids in-class initialization of non-const static member 'Stack::byFull'
31 | static int byFull = 1000;
| ^~~~~~
a.cc:32:11: error: size of array 'v' is not an integral constant-expression
32 | int v[byFull];
| ^~~~~~
|
s441541241 | p02263 | C++ | #include <stdio.h>
#include <string.h>
int pop();
void push(int );
int x[1000],top;
int main(){
top=0;
char c[100];
int a,b;
while(scanf("%s",c)!=EOF){
if(c[0]=='+'){
a=pop();
b=pop();
push(a+b);
}
else if(c[0]=='-'){
b=pop();
a=pop();
push(a-b);
}
else... | a.cc: In function 'int main()':
a.cc:27:12: error: 'atoi' was not declared in this scope
27 | push(atoi(c));
| ^~~~
|
s065015700 | p02263 | C++ | #include <stdio.h>
#include <stdlib.h>
int pop();
void push(int );
int x[1000],top;
int main(){
top=0;
char c[100];
int a,b;
while(scanf("%s",c)!=EOF){
if(c[0]=='+'){
a=pop();
b=pop();
push(a+b);
}
else if(c[0]=='-'){
b=pop();
a=pop();
push(a-b);
}
else... | a.cc:35:2: error: 'gcc' does not name a type
35 | }gcc
| ^~~
|
s859670863 | p02263 | C++ | #include <stdio.h>
void insert(int);
void delete(int);
void deleteFirst(void);
void deleteLast(void);
int data[2000000];
int m=0;
int main(){
int n,i,x;
char com[20];
scanf("%d",&n);
for(i=0 ; i<n ; i++){
data[i]=0;
}
for(i=0 ; i<n ; i++){
scanf("%s",com);
if(com[0]=='i') {
scanf("%d",&x);
i... | a.cc:4:6: error: expected unqualified-id before 'delete'
4 | void delete(int);
| ^~~~~~
a.cc: In function 'int main()':
a.cc:32:12: error: type 'int' argument given to 'delete', expected pointer
32 | delete(x);
| ~^~
a.cc: At global scope:
a.cc:56:6: error: expected unqualified-id ... |
s935843694 | 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
| |
s915627336 | p02263 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int main(){
string str;
int a,b;
stack<string> stck;
while(cin>>str){
stck.push(str);
if(stck.top()=="+"){
stck.pop();
a = stoi(stck.top());
stck.pop();
b = stoi(stck... | a.cc: In function 'int main()':
a.cc:59:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void')
59 | cout << stck.pop()<<endl;
| ~~~~ ^~ ~~~~~~~~~~
| | |
| | void
| std::ostream {aka std::basic_os... |
s592797075 | 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
| |
s643823890 | p02263 | C++ | include <stdio.h>
#include <stdlib.h>
#define STACK_MAX 20 /* スタックサイズ */
#define STACK_OK 0x8000 /* スタック成功を表すデータ */
#define STACK_FULL STACK_OK + 1 /* スタックサイズを超えたときのデータ */
#define STACK_END STACK_OK + 2 /* スタックの終わりを表すデータ */
int push(int); /* スタックにデータを積む関数 */
int pop... | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:19:26: error: expected ')' before ';' token
19 | for(i=0;scanf("%s",A[i];)!=EOF;i++);
| ~ ^
| )
a.cc:19:28: error: expected prim... |
s997334345 | p02263 | C++ | include <stdio.h>
#include <stdlib.h>
#define STACK_MAX 20
#define STACK_OK 0x8000
#define STACK_FULL STACK_OK + 1
#define STACK_END STACK_OK + 2
int push(int);
int pop(void);
int stack[STACK_MAX];
int stack_pointer = 0;
int main(void)
{
char A[100];
in... | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:19:26: error: expected ')' before ';' token
19 | for(i=0;scanf("%s",A[i];)!=EOF;i++);
| ~ ^
| )
a.cc:19:28: error: expected prim... |
s025479733 | p02263 | C++ | 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 'void push(int)':
a.cc:2:5: error: 'S' was not declared in this scope
2 | S[++top] = x;
| ^
a.cc:2:9: error: 'top' was not declared in this scope
2 | S[++top] = x;
| ^~~
a.cc: In function 'int pop()':
a.cc:6:5: error: 'top' was not declared in this scope; did yo... |
s927025677 | p02263 | C++ | 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 'void push(int)':
a.cc:2:5: error: 'S' was not declared in this scope
2 | S[++top] = x;
| ^
a.cc:2:9: error: 'top' was not declared in this scope
2 | S[++top] = x;
| ^~~
a.cc: In function 'int pop()':
a.cc:6:5: error: 'top' was not declared in this scope; did yo... |
s111410790 | p02263 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top,S[1000];
void push(int x){
top++;
S[top]=x;
/*S[++top]となる
S[top++]はだめ*/
}
int pop(){
top--;
return[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);
... | a.cc: In function 'int pop()':
a.cc:15:24: warning: capture of variable 'top' with non-automatic storage duration
15 | return[top+1];
| ^~~
a.cc:5:5: note: 'int top' declared here
5 | int top,S[1000];
| ^~~
a.cc:15:27: error: expected ',' before '+' token
... |
s958502499 | p02263 | C++ | #include<iostream>
#include<string>
using namespace std;
int S[3];
int top = 0;
void push(int x) {
top += 1;
S[top] = x;
}
int pop() {
top -= 1;
return S[top+1];
}
int main() {
char c;
int a, b;
while(cin >> c){
if (c=="+") {
a = pop();
b = pop();
push(a+b);
} else if (c=="-"... | a.cc: In function 'int main()':
a.cc:22:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
22 | if (c=="+") {
| ~^~~~~
a.cc:26:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
26 | } else if (c=="-") {
| ~^~~~... |
s279804669 | p02263 | C++ | #include<iostream>
#include<string>
using namespace std;
int S[3];
int top = 0;
void push(int x) {
top += 1;
S[top] = x;
}
int pop() {
top -= 1;
return S[top+1];
}
int main() {
string c;
int a, b;
while(cin >> c){
if (c=="+") {
a = pop();
b = pop();
push(a+b);
} else if (c=="... | a.cc: In function 'int main()':
a.cc:35:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
35 | push(atoi(c));
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr... |
s379219421 | p02263 | C++ | #include<iostream>
#include<string>
using namespace std;
int S[200];
int top = 0;
void push(int x) {
top += 1;
S[top] = x;
}
int pop() {
return S[top--];
}
int main() {
string s;
char c;
int a, b;
cin >> s;
int i=0;
while(c = s[i]){
if (c=='+') {
a = pop();
b = pop();
push(a+... | a.cc: In function 'int main()':
a.cc:37:16: error: no matching function for call to 'stoi(char&)'
37 | push(stoi(c));
| ~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bit... |
s592103513 | p02263 | C++ | #include<iostream>
#include<string>
using namespace std;
int S[200];
int top = 0;
void push(int x) {
top += 1;
S[top] = x;
}
int pop() {
return S[top--];
}
int main() {
string s;
char c;
int a, b;
cin >> s;
int i=0;
while(c = s[i]){
if (c=='+') {
a = pop();
b = pop();
push(a+... | a.cc: In function 'int main()':
a.cc:37:17: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
37 | push(atoi(c));
| ^
| |
| char
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.