submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s656512863 | 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(... | main.c: In function 'main':
main.c:53:5: error: expected declaration or statement at end of input
53 | return 0;
| ^~~~~~
|
s471864107 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top,S[1000];
void push(int);
int main(){
int x,a,b;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
a=pop();
b=pop();
push(a+b);
} else if ( s[0] == '-' ){
a=pop();
b=pop();
push(a-b);
... | main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'pop'; did you mean 'popen'? [-Wimplicit-function-declaration]
13 | a=pop();
| ^~~
| popen
|
s910027671 | p02263 | C | #include <stdio.h>
int main(){ | main.c: In function 'main':
main.c:3:1: error: expected declaration or statement at end of input
3 | int main(){
| ^~~
|
s941181572 | 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 i... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'push':
main.c:8:3: error: 'S' undeclared (first use in this function)
8 | S[++top] = x;
| ^
main.c:8:3: note: each undeclared identifier is reported only once... |
s032116689 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top=0,S[100];
void push(int);
int pop(void);
int isEmpty(void);
int isFULL(void);
int main(){
int x,a,b;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
a=pop();
b=pop();
push(a+b);
} else if ( s[0] == '-' ... | main.c:39:3: error: expected identifier or '(' before 'if'
39 | if(top>=100-1)return 0;
| ^~
main.c:40:3: error: expected identifier or '(' before 'return'
40 | return 1;
| ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
41 | }
| ^
main.c: In function 'isFULL':
... |
s452268059 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top=0,S[100];
void push(int);
int pop(void);
int isEmpty(void);
int isFULL(void);
int main(){
int x,a,b;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
a=pop();
b=pop();
push(a+b);
} else if ( s[0] == '-' ... | main.c:39:3: error: expected identifier or '(' before 'if'
39 | if(top>=100-1)return 0;
| ^~
main.c:40:3: error: expected identifier or '(' before 'return'
40 | return 1;
| ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
41 | }
| ^
|
s677618807 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top=0,S[100];
void push(int);
int pop(void);
int isEmpty(void);
int isFULL(void);
int main(){
int x,a,b;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
a=pop();
b=pop();
push(a+b);
} else if ( s[0] == '-' ... | main.c:39:3: error: expected identifier or '(' before 'if'
39 | if(top>=100-1)return 0;
| ^~
main.c:40:3: error: expected identifier or '(' before 'return'
40 | return 1;
| ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
41 | }
| ^
|
s555066143 | p02263 | C | #include<stdio.h>
#define STACK_SIZE 100
#define MAX_LEN 100
int pop();
int push(int);
int is_digit(char *);
int get_number(char *);
int calc_rpn(char *);
int stack[STACK_SIZE];
int stack_size = 0;
int main(){
char s[MAX_LEN];
scanf("%[^\n]*s",s);
printf("%d\n",calc_rpn(s));
return 0;
}
int pop()
... | main.c: In function 'calc_rpn':
main.c:116:1: error: expected declaration or statement at end of input
116 | }
| ^
|
s089363228 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100
void initialize(void)
int isempty(void);
int isfull(void);
void push(int);
int pop(void);
int top;
int stack[MAX];
int main()
{
int a, b;
char s[MAX];
initialize();
while(scanf("%s", s) != EOF) {
switch(s[0]) {
case '+':
a = pop();
b... | main.c: In function 'initialize':
main.c:16:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
16 | {
| ^
main.c:47:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
47 | {
| ^
main.c:52:1: error: expected '=', ',', ';', 'asm' or '__attribute__' befor... |
s800327286 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100
int isempty(void);
int isfull(void);
void push(int);
int pop(void);
int top = 0;
int stack[MAX];
int main()
{
int a, b;
char s[MAX];
initialize();
while(scanf("%s", s) != EOF) {
if(s[0] == '+') {
push(pop()+pop());
}
else if(s[0] == '-... | main.c: In function 'main':
main.c:18:3: error: implicit declaration of function 'initialize' [-Wimplicit-function-declaration]
18 | initialize();
| ^~~~~~~~~~
|
s156000714 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100
int isempty(void);
int isfull(void);
int push(int);
int pop(void);
int top = 0;
int stack[MAX];
int main()
{
int x, a, b;
char s[100];
while(scanf("%s", s) != EOF) {
if(s[0] == '+') {
push(pop()+pop());
}
else if(s[0] == '-') {
a =... | main.c:55:6: error: conflicting types for 'push'; have 'void(int)'
55 | void push(int x)
| ^~~~
main.c:8:5: note: previous declaration of 'push' with type 'int(int)'
8 | int push(int);
| ^~~~
|
s865596003 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int push(int x);
int pop();
int isEmpty();
int isFULL();
int Stack[MAX];
int top;
int main(){
int x,a,b;
char s[100];
initialize();
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
push(pop() + pop());
}
else if ( ... | main.c: In function 'main':
main.c:15:3: error: implicit declaration of function 'initialize' [-Wimplicit-function-declaration]
15 | initialize();
| ^~~~~~~~~~
main.c: At top level:
main.c:52:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
52 | top--;
| ^~
main.... |
s690644088 | p02263 | C | int stack[MAX];
int main()
{
int x, a, b;
char s[100];
while(scanf("%s", s) != EOF) {
if(s[0] == '+') {
push(pop()+pop());
}
else if(s[0] == '-') {
a = pop();
b = pop();
push(b-a);
}
else if(s[0] == '*') {
push(pop()*pop());
}
else {
x = atoi(s);
... | main.c:1:11: error: 'MAX' undeclared here (not in a function)
1 | int stack[MAX];
| ^~~
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
7 | while(scanf("%s", s) != EOF) {
| ^~~~~
main.c:1:1: note: include '... |
s993002910 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000
void push(int);
int pop(void);
int Stack[MAX];
int top=0;
int main(){
int a,b;
top = 0;
char stack[100];
while(scanf("%s",stack)!=EOF){
if(stack[0]=='+'){
a = pop();
b = pop();
push(a+b);
}
else if(s... | main.c: In function 'pop':
main.c:52:3: error: expected declaration or statement at end of input
52 | return Stack[top+1];
| ^~~~~~
|
s961223624 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int push(int x);
int pop();
int isEmpty();
int isFULL();
int Stack[MAX];
int top=0;
int main(){
int x,a,b;
char s[100];
initialize();
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
push(pop() + pop());
}
else if ... | main.c: In function 'main':
main.c:15:3: error: implicit declaration of function 'initialize' [-Wimplicit-function-declaration]
15 | initialize();
| ^~~~~~~~~~
|
s118644780 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100
//prototype
void push(int);
int pop();
void isEmpty();
void isFull();
//global variables
int S[MAX + 1]; //opeland
int top=1;
void push(int x){
//overflow
isFull(); //full??????exit()
S[top] = x;
// printf("push: %d\n",x);
top++;
}
int pop(){
int... | main.c: In function 'main':
main.c:62:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'S'
62 | S[0] = 0;
| ^
main.c:65:21: error: 'x' undeclared (first use in this function)
65 | while(scanf("%s", x)!=EOF){
| ^
main.c:65:21: note: each undeclared identifier ... |
s163080314 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top=0,S[100];
void push(int);
int pop(void);
int isempty(void);
int isfull(void);
int main(){
int a,b,x;
char s[100];
while(scanf("%s",s)!=EOF){
if(s[0]=='+'){
a=pop();
b=pop();
push(a+b);
}
else if(s[0]=='-'){
... | /usr/bin/ld: /tmp/cciXAPmt.o: in function `main':
main.c:(.text+0x16): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x1e): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x30): undefined reference to `push'
/usr/bin/ld: main.c:(.text+0x3f): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x4... |
s966705775 | p02263 | C | sa | main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | sa
| ^~
|
s239690891 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
} else if ( s[0] == '-' ){
} else if ( s[0] == '*' ){
} else {
x = atoi(s);
}
}
initialize()
top=0;
isEmpty()
return top==... | main.c: In function 'main':
main.c:23:3: error: implicit declaration of function 'initialize' [-Wimplicit-function-declaration]
23 | initialize()
| ^~~~~~~~~~
main.c:23:15: error: expected ';' before 'top'
23 | initialize()
| ^
| ;
24 | top=0;
| ... |
s852332578 | p02263 | C | #include<stdio.h>
int top=0;
itn push(int);
int pop(void);
int main(){
int x,y,z;
char d[100];
while(scanf("%d",d)!=EOF){
if(d[0]=='+'){
x=pop();
y=pop();
push(x+y);
}
else if(d[0]=='-'){
x=pop();
y=pop();
push(x-y);
}
else if(d[0]=='*'){
x=pop(... | main.c:4:1: error: unknown type name 'itn'; did you mean 'int'?
4 | itn push(int);
| ^~~
| int
main.c: In function 'main':
main.c:33:9: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
33 | z=atoi(d);
| ^~~~
main.c: In function 'push':
main.c:46:3: ... |
s090781600 | p02263 | C | #include <stdio.h>
int a[500],head=0;
int main(){
????int b,num=0;
????char c;
??????
????while( (scanf("%c",&c))!=EOF){
????????if(num==0&&c=='0'){ a[head]=num;
????????????head++;}
??
????????????if(a<='9'&&c>='0'){num=c-'0'+num*10;}??????????
????????????else if(num!=0){??
????????a[head]=num;
????????head++;
???... | main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
4 | ????int b,num=0;
| ^
main.c:5:1: error: expected expression before '?' token
5 | ????char c;
| ^
main.c:6:1: error: expected expression before '?' token
6 | ??????
| ^
main.c:34:26: error: expected expr... |
s351444548 | p02263 | C | #include<stdio.h>
#define STACK_SIZE 100
#define TRUE 1
#define FALSE 0
int stack[STACK_SIZE];
int *top=&stack[1];
void isEmpty(int stack){
if(stack.top==0){
return TRUE;
}else{
return FALSE;
}
}
int push(int stack,int x){
stack.top=stack.top+1;
stack[stack.top]=x;
}
int pop(int stack){
... | main.c: In function 'isEmpty':
main.c:10:11: error: request for member 'top' in something not a structure or union
10 | if(stack.top==0){
| ^
main.c:3:14: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
3 | #define TRUE 1
| ^
main.c:11:12: note: i... |
s647151245 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void push(int* , int);
int isempty(void);
int pop(int*);
int top=0;
int main(){
int i,time=0,y,x,in;
int num[100];
char s[100];
while(scanf("%s",s)!==EOF){
if(s[0]=='+'){
y=pop(num);
x=pop(num);
in=x+y;
push(num,in);
... | main.c: In function 'main':
main.c:17:24: error: expected expression before '=' token
17 | while(scanf("%s",s)!==EOF){
| ^
|
s314206359 | p02263 | C | int pop(int *);
int isFull(void);
int top=0;
int main(){
int x,data[2];
int a[100];
char s[100];
while(scanf("%s",s)!=EOF){
if(s[0]=='+'|| s[0]=='-'||s[0]=='*'){
data[0]=pop(a);
data[1]=pop(a);
}
if(s[0]=='+'){
push(data[1]+data[0],a);
}else if(s[0]=='-'){
push(data[1]... | main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
12 | while(scanf("%s",s)!=EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int pop(int *);
main.c:12:9: ... |
s323105081 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
void push(int,int *);
int pop(int *);
int isFull(void);
int top=0;
int main(){
int x,data[2];
int a[100];
char s[100];
while(scanf("%s",s)!=EOF){
if(s[0]=='+'|| s[0]=='-'||s[0]=='*'){
data[0]=pop(a);
data[1]=pop(a);
}
if(s[0]=='+'){
pus... | main.c:51:1: error: expected identifier or '(' before '}' token
51 | }
| ^
|
s989285879 | p02263 | C | #include <stdlib.h>
#include <string.h>
int pop();
void push(int);
int s[100],top = 0;
int main() {
int x, y, z;
char str[100];
while(scanf("%s",str) != EOF) {
if ( str[0] == '+' ){
x = pop();
y = pop();
push(x + y);
} else if ( str[0] == '-' ){
x = pop();
y = pop();
... | main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
13 | while(scanf("%s",str) != EOF) {
| ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
2 | #include <string.h>
+++ |+#include <stdio.h>
... |
s842588328 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define N 100
int push(int);
int pop(void);
int isempty(void);
static int stack[N+1],p;
main()
{
int a,b,i,x;
char c[N];
printf("逆ポーランド法で入力してください(例)12+: ");
scanf("%s",c);
for(i=0;c[i]!='\0';i++){
if(c[i]<='9'&&c[i]>='0')
x=atoi(c[i]);
push(x);
else
switch(c[i]){
case '+':... | main.c:10:1: error: return type defaults to 'int' [-Wimplicit-int]
10 | main()
| ^~~~
main.c: In function 'main':
main.c:23:9: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
23 | x=atoi(c[i]);
| ~^~~
| |
| char
In fil... |
s163802389 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int i=1,j=1,x[100],ans=0,y[100];
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
if(i==1)ans=y[i-1]+y[i];
else {
y[j]=x[i-1]+x[i];
i=1;
j++;
}
}
else if ( s[0] == '-' ){
... | main.c: In function 'main':
main.c:39:3: error: expected declaration or statement at end of input
39 | printf("%d\n",ans);
| ^~~~~~
|
s247704341 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define N 200
int main(void){
int a, b, ans, i=0;
char *S[N];
while(scanf("%s",&S[i]) != EOF){
i++;
switch(*S[i]){
case '+':
a = atoi(S[i-2]);
b = atoi(S[i-1]);
ans = a + b;
itoa(ans, S[i-2],10);
i--;
case '*':
a = atoi... | main.c: In function 'main':
main.c:18:7: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
18 | itoa(ans, S[i-2],10);
| ^~~~
|
s575089731 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int pop(void);
void push(int );
int isEmpty();
int isFull();
int stack[101];
int top=0;
int main(){
int x;
int sum=0,sub,sub1,multi=1;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
sum+=pop();
// printf("%d",sum);
... | /usr/bin/ld: /tmp/cc4Bbg7r.o: in function `pop':
main.c:(.text+0x11b): undefined reference to `isFull'
/usr/bin/ld: /tmp/cc4Bbg7r.o: in function `push':
main.c:(.text+0x16d): undefined reference to `isEmpty'
collect2: error: ld returned 1 exit status
|
s429372042 | p02263 | C | #define TRUE 1
#define FALSE 0
#define N 300
int stack[STACK_SIZE];
int top=0;
int isEmpty(){
if(stack[top]==0){
return TRUE;
}else{
return FALSE;
}
}
void push(int a){
top++;
stack[top]=a;
}
int pop(){
if(isEmpty()==TRUE){
printf("error underflow\n");
}else{
return stack[top--... | main.c:5:11: error: 'STACK_SIZE' undeclared here (not in a function)
5 | int stack[STACK_SIZE];
| ^~~~~~~~~~
main.c: In function 'pop':
main.c:23:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
23 | printf("error underflow\n");
| ^~~~~~
main.c:1... |
s789123322 | p02263 | C | # define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdbool.h>
# define STACK_MAX 200 /* ???????????????????????§(100) + ?????????????????§(99) + 1 */
void push(value);
int pop();
int main(void);
bool isNum(char c);
char* getOperand();
static int st_stack_index = 0;
... | main.c:9:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
9 | void push(value);
| ^~~~
main.c: In function 'main':
main.c:70:2: error: #endif without #if
70 | #endif
| ^~~~~
main.c: In function 'push':
main.c:105:6: error: type of 'value' defau... |
s763805169 | p02263 | C | # define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdbool.h>
# define STACK_MAX 200 /* ???????????????????????§(100) + ?????????????????§(99) + 1 */
void push(value);
int pop();
int main(void);
bool isNum(char c);
char* getOperand();
static int st_stack_index = 0;
... | main.c:9:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
9 | void push(value);
| ^~~~
main.c: In function 'push':
main.c:104:6: error: type of 'value' defaults to 'int' [-Wimplicit-int]
104 | void push(value) {
| ^~~~
main.c: In function 'g... |
s985528857 | p02263 | C | # define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdbool.h>
# define STACK_MAX 200 /* ???????????????????????§(100) + ?????????????????§(99) + 1 */
void push(value);
int pop();
int main(void);
bool isNum(char c);
char* getOperand(char buf[]);
static int st_stack_i... | main.c:9:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
9 | void push(value);
| ^~~~
main.c: In function 'main':
main.c:29:27: error: expected expression before 'char'
29 | while (getOperand(char buf[]) != NULL) {
| ... |
s160231939 | p02263 | C | a | main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | a
| ^
|
s827280545 | p02263 | C | #include<stdio.h>
#include <stdlib.h>
#include <string.h>
int top = -1;
int push(int);
int pop(void);
char in[6];
int stack[100],n,m;
int main(void){
while(scanf("%s",in) != EOF){
if(in[1] == '+'){
n=pop();
m=pop();
push(m+n);
}
else if(in[1] == '-'){
n=pop();
m=pop();
push(m-n);... | main.c: In function 'pop':
main.c:64:20: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
64 | stack[top] = NULL;
| ^
main.c:65:9: error: expected declaration or statement at end of input
65 | top--;
| ^~~
|
s148132642 | 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);
... | main.c: In function 'main':
main.c:22:13: warning: comparison between pointer and integer
22 | if(s[0] == " + "){
| ^~
main.c:26:18: warning: comparison between pointer and integer
26 | }else if(s[0] == "-"){
| ^~
main.c:30:18: warning: comparison between pointer an... |
s842495702 | p02263 | C | clude<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);
}el... | main.c:1:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | clude<stdio.h>
| ^
In file included from main.c:2:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
| ^~~~~~
/usr/include/s... |
s425714603 | 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);
... | main.c: In function 'main':
main.c:22:13: warning: comparison between pointer and integer
22 | if(s[0] == " + "){
| ^~
main.c:26:18: warning: comparison between pointer and integer
26 | }else if(s[0] == "-"){
| ^~
main.c:30:18: warning: comparison between pointer an... |
s920633129 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
main(){
char op[1000200];
int memory[100],cnt=0;
while(scanf(%s,op)!=EOF){
if(op=="+"){
memory[cnt-2]+=memory[cnt-1];
cnt--;
}else if(op=="-"){
memory[cnt-2]-=memory[cnt-1];
cnt--;
}else if(op=="*"){
memory[cnt-2]*=memory[cnt-1];
... | main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:15: error: expected expression before '%' token
6 | while(scanf(%s,op)!=EOF){
| ^
|
s161849313 | p02263 | C | #include <stdio.h>
#include <math.h>
#define MAX_ELE 1000000
int stack[102];
int stack_num = 0;
//functions
void calc(int op);
int main(void){
int i=0;
char tmp=0,c;
int tmp_array[8],tmp_num=0;
int num=0;
int polish[201];
//input
while(tmp != '='){
scanf("%c",&tmp);
if(tmp == '=') break;
if(tmp == ' ... | main.c: In function 'main':
main.c:52:1: error: implicit declaration of function 'peintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
52 | peintf("\n");
| ^~~~~~
| printf
main.c: In function 'calc':
main.c:56:6: error: type of 'op' defaults to 'int' [-Wimplicit-int]
56 | void calc(op){
... |
s342756070 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top,S[1000];
void push(int x){
S[++top] = x;
for(i = 1;i <= top; i++){
printf("S[%d] = %d",i,S[i]);
if(i != top){
printf(" ");
}
else{
printf("\n");
}
}
}
int pop(){
top--;
return S[top+1];
}
int main(){
int a,b;
top = 0;
char s[100... | main.c: In function 'push':
main.c:9:13: error: 'i' undeclared (first use in this function)
9 | for(i = 1;i <= top; i++){
| ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
|
s581660255 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int i=0;
int num[100];
char stack[100];
while( scanf("%s", stack) != EOF ){
if ( stack[0] == '+' ){
num[i-2]=num[i-2]+num[i-1];
i--;
} else if ( stack[0] == '-' ){
num[i-2]=num[i-2]-num[i-1];
i--;
} else if ( stack[0] == '*' )... | main.c: In function 'main':
main.c:26:16: error: 'x' undeclared (first use in this function)
26 | printf("%d\n",x[0]);
| ^
main.c:26:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:2: error: expected declaration or statement at end of input
... |
s192803661 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
int top,S[10000];
void push(int x){
S[++top]=x;
}
int pop(){
return S[top--];
}
int main(){
int a,b;
char s;
top=0;
while(scanf("%s",s)!=EOF){
if(s[0]=='+'){
b=pop();
a=pop();
push(a+b);
}else if(s =='-'){
b=pop();
a=pop()... | main.c: In function 'main':
main.c:20:9: error: subscripted value is neither array nor pointer nor vector
20 | if(s[0]=='+'){
| ^
main.c:33:17: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
33 | push(atoi(s));
| ^
... |
s547770347 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
int top, S[100];
void push(int x){
top++
S[top]=x;
}
int pop(){
top--
return S[top+1];
}
int main(void){
int a,b;
char s[100];
top=0;
while(scanf("%s",s)!=EOF){
if(s[0]=='+'){
b=pop();
a=pop();
push(a+b);
}else if(s[0]=='-'){
b=pop();
a=pop();
... | main.c: In function 'push':
main.c:7:14: error: expected ';' before 'S'
7 | top++
| ^
| ;
8 | S[top]=x;
| ~
main.c: In function 'pop':
main.c:12:14: error: expected ';' before 'return'
12 | top--
| ^
| ... |
s987025897 | p02263 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define mymalloc(p,n) {p = malloc((n)*sizeof(*p));if ((p)==NULL) {printf("not enough memory?\n"); exit(1);};}
typedef struct obj{
int value;
struct obj *next;
struct obj *prev;
}obj;
typedef struct{
obj *root;
}stack;
obj *createObj(int v,obj *pre,obj *nex)... | main.c: In function 'pop':
main.c:38:9: error: stray '\' in program
38 | \\printf("pop %d\n",value);
| ^
main.c:38:10: error: stray '\' in program
38 | \\printf("pop %d\n",value);
| ^
main.c: In function 'push':
main.c:49:9: error: stray '\' in program
49 | ... |
s347027132 | p02263 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define mymalloc(p,n) {p = malloc((n)*sizeof(*p));if ((p)==NULL) {printf("not enough memory?\n"); exit(1);};}
typedef struct obj{
int value;
struct obj *next;
struct obj *prev;
}obj;
typedef struct{
obj *root;
}stack;
obj *createObj(int v,obj *pre,obj *nex)... | main.c: In function 'pop':
main.c:38:9: error: stray '\' in program
38 | \\printf("pop %d\n",value);
| ^
main.c:38:10: error: stray '\' in program
38 | \\printf("pop %d\n",value);
| ^
main.c: In function 'push':
main.c:49:9: error: stray '\' in program
49 | ... |
s516848392 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int top = 0, S[1000];
void push(int x) {
S[++top] = x;
}
int pop() {
top--;
return S[top + 1];
}
int main() {
int a, b;
char s[100];
while (scanf_s("%s", &s) != EOF) {
if (s[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else if (s[0... | main.c: In function 'main':
main.c:19:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
19 | while (scanf_s("%s", &s) != EOF) {
| ^~~~~~~
| scanf
|
s988343971 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int top = 0, S[1000];
void push(int x) {
S[++top] = x;
}
int pop() {
top--;
return S[top + 1];
}
int main() {
int a, b;
char s[100];
while (scanf_s("%s", &s) != EOF) {
if (s[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else if (s[0... | main.c: In function 'main':
main.c:19:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
19 | while (scanf_s("%s", &s) != EOF) {
| ^~~~~~~
| scanf
|
s069818391 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int top;S[1000];
void push(int x){
S[++top]=x;
}
void pop(){
return S[top];
top--;
}
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... | main.c:5:9: warning: data definition has no type or storage class
5 | int top;S[1000];
| ^
main.c:5:9: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c: In function 'pop':
main.c:12:10: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
12 | ret... |
s399950729 | p02263 | C | #include<iostream>
#include<istream>
#include<string>
using namespace std;
int top, S[200];//?????¶??????top?????¨??\?????¨??°???????????´??´?????°???S
void push(int x)
{
top++;
//cout<<"top:"<<top<<endl;
S[top] = x; //??\?????¶?????????????????°???
}
int pop()
{
int x= S[top];//cout<<"top:"<<top<<endl;
top--;//?... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s117720541 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
using namespace std;
int top, S[200];//?????¶??????top?????¨??\?????¨??°???????????´??´?????°???S
void push(int x)
{
top++;
S[top] = x; //??\?????¶?????????????????°???
}
int pop()
{
int x= S[top];
top--;//????????¶??????????????°?????????????????????
retur... | main.c:4:1: error: unknown type name 'using'
4 | using namespace std;
| ^~~~~
main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
4 | using namespace std;
| ^~~
|
s459592698 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int top,S[1000];
void push(int x){
S[top+1] = x;
top++;
}
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] == '+'){
... | main.c:5:1: error: unknown type name 'using'
5 | using namespace std;
| ^~~~~
main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
5 | using namespace std;
| ^~~
|
s520003229 | 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() {
char s[100];
int a, b;
top = 0;
while (scanf_s("%s", s, 1) != EOF) {
if (s[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else ... | main.c: In function 'main':
main.c:21:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
21 | while (scanf_s("%s", s, 1) != EOF) {
| ^~~~~~~
| scanf
|
s247656139 | 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() {
char s[100];
int a, b;
top = 0;
while (scanf_s("%s", s, 1) != EOF) {
if (s[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else ... | main.c: In function 'main':
main.c:21:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
21 | while (scanf_s("%s", s, 1) != EOF) {
| ^~~~~~~
| scanf
main.c:38:33: error: implicit declaration of function 'sto... |
s916919026 | 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() {
char s[100];
int a, b;
top = 0;
while (scanf("%s", s) != EOF) {
if (s[0] == '+') {
a = pop();
b = pop();
push(a + b);
}
else if (... | main.c: In function 'main':
main.c:38:33: error: implicit declaration of function 'stoi'; did you mean 'atoi'? [-Wimplicit-function-declaration]
38 | int i = stoi(s);
| ^~~~
| atoi
|
s139066787 | p02263 | C | int isFull(void);
void push(int x);
int pop(void);
int top;
int S[MAX];
int main(){
int ans=0;
char x;
initialize();
while(1){
if(scanf(" %c",&x)!=1) break;
if(x>='0' && x<='9'){
push((int)x);
printf("%c\n",x);
}
else if ( x == '+' ){
ans=pop()+pop()-96;
} else if ( x ==... | main.c:5:7: error: 'MAX' undeclared here (not in a function)
5 | int S[MAX];
| ^~~
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'initialize' [-Wimplicit-function-declaration]
9 | initialize();
| ^~~~~~~~~~
main.c:11:8: error: implicit declaration of funct... |
s086333790 | p02263 | C | include <stdio.h>
#define STACK_SIZE 100
int stack[STACK_SIZE];
int stack_size = 0;
int pop()
{
if (stack_size <= 0) return 0;
return stack[--stack_size];
}
int push(int a)
{
stack[stack_size++] = a;
}
int calc(char *s)
{
int a, b, type;
while (*s) {
switch(*s) {
case ' ':
break;
case '+... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c: In function 'pop':
main.c:10:10: error: 'stack' undeclared (first use in this function)
10 | return stack[--stack_size];
| ^~~~~
main.c:10:10: note: each undeclare... |
s962349296 | p02263 | C | int pop();
int top;
int s[100];
int main(){
int a,b;
char t[8];
while( scanf("%s", t) != EOF ){
if ( t[0] == '+' ){
a=pop();
b=pop();
push(a+b);
}
else if ( t[0] == '-' ){
a=pop();
b=pop();
push(b-a);
}
else if ( t[0] == '*' ){
a=pop();
b=pop... | main.c: In function 'main':
main.c:9:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | while( scanf("%s", t) != EOF ){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int pop();
main.c:9:10:... |
s618352337 | p02263 | C |
}
}
printf(" %d\n",pop());
} | main.c:3:5: error: expected identifier or '(' before '}' token
3 | }
| ^
main.c:4:3: error: expected identifier or '(' before '}' token
4 | }
| ^
main.c:5:10: error: expected declaration specifiers or '...' before string constant
5 | printf(" %d\n",pop());
| ^~~~~~~
... |
s246008920 | p02263 | C | include <stdio.h>
#include <stdlib.h>
#include <string.h>
int top;
int isEmpty() {
return ((top == 0)? 1:0);
}
void push(int *s, int x) {
top++;
s[top] = x;
}
int pop(int *s) {
if (isEmpty()) {
fprintf(stderr, "underflow\n");
} else {
top--;
}
return s[top + 1];
}
int main() {
int x,tmp;
int stack[10... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
In file included from main.c:2:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
| ^~~~~~
/usr/inc... |
s995344279 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int isEmpty();
void push(int);
int pop();
int top=0,s[100];
int main(){
int t1,t2;
char c[10];
while(scanf("%s",c)!=EOF){
if(c[0]=='+'||c[0]=='-'||c[0]=='*'){
t1=pop();
t2=pop();
if(c[0]=='+')t2+=t1;
else if(c[0]=='-')t2-=t1;
else if(c[0... | main.c: In function 'main':
main.c:21:12: error: 'res' undeclared (first use in this function)
21 | push(res);
| ^~~
main.c:21:12: note: each undeclared identifier is reported only once for each function it appears in
|
s122469208 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int isEmpty();
void push(int);
int pop();
int top=0,s[100];
int main(){
int t1,t2;
char c[10];
while(scanf("%s",c)!=EOF){
if(c[0]=='+'||c[0]=='-'||c[0]=='*'){
t1=pop();
t2=pop();
if(c[0]=='+')t2+=t1;
else if(c[0]=='-')t2-=t1;
else if(c[0... | main.c: In function 'main':
main.c:21:12: error: 'res' undeclared (first use in this function)
21 | push(res);
| ^~~
main.c:21:12: note: each undeclared identifier is reported only once for each function it appears in
|
s214904559 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int isEmpty();
void push(int*,int);
int pop(int*);
int top=0;
int main(){
int s[100],t1,t2;
char c[10];
while(scanf("%s",c)!=EOF){
if(c[0]=='+'||c[0]=='-'||c[0]=='*'){
t1=pop(s);
t2=pop(s);
if(c[0]=='+')t2+=t1;
else if(c[0]=='-')t2-=t1;
... | main.c: In function 'main':
main.c:21:14: error: 'res' undeclared (first use in this function)
21 | push(s,res);
| ^~~
main.c:21:14: note: each undeclared identifier is reported only once for each function it appears in
|
s052636773 | p02263 | C | void push(int x)
{
if(isFull() == 0){
top++;
S[top] = x;
}
else fprintf(stderr, "error\n");
}
int pop(void)
{
if(isEmpty() == 0){
top--;
return S[top+1];
}
else fprintf(stderr, "error\n");
}
int isFull( void )
{
if(top > N -1) return 1;
else return 0;
}
int isEmpty( void )
{
if(top == 0) r... | main.c: In function 'push':
main.c:3:6: error: implicit declaration of function 'isFull' [-Wimplicit-function-declaration]
3 | if(isFull() == 0){
| ^~~~~~
main.c:4:3: error: 'top' undeclared (first use in this function)
4 | top++;
| ^~~
main.c:4:3: note: each undeclared identifier is repo... |
s989156389 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1000
??
int S[MAX];
int top;
void initialize(void);
int isEmpty(void);
int isFull(void);
void push(int);
int pop(void);
int main()
{
int a,b,x;
char s[100];
while( scanf("%s", s) != EOF )
{
if ( s[0] == '+' )
{
a = pop();
... | main.c:6:1: error: expected identifier or '(' before '?' token
6 | ??
| ^
main.c: In function 'main':
main.c:48:17: error: 'S' undeclared (first use in this function)
48 | printf("%d\n",S[1]);
| ^
main.c:48:17: note: each undeclared identifier is reported only once for each function... |
s670961191 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define N 199
#define M 100
int push(int);
int pop(int);
int topa = 0, topb = 0;
int main(){
int x,y;
char S[N];
int A[M];
while(scanf("%s",S) != EOF){
if(S[topa] == '+'){
x=pop(A[topb]);
y=pop(A[topb]);
A[topb]=push(y+x);
}
else if(S[to... | main.c: In function 'main':
main.c:35:6: error: expected declaration or statement at end of input
35 | }
| ^
main.c:35:6: error: expected declaration or statement at end of input
|
s499345818 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100
#define NUMBER '0'
void initialize(void);
void push(int);
int pop(void);
int isEmpty(int);
int isFull(int);
int top;
int main(){
int i,c,s,type;
int count=0;
int pop2;
char S[MAX];
initialize();
/*
for(i=0;i<MAX;i++){
c = scanf("%c",S[i]);
... | main.c: In function 'main':
main.c:36:17: error: implicit declaration of function 'getop' [-Wimplicit-function-declaration]
36 | while((type = getop(S)) != EOF){
| ^~~~~
main.c:66:19: error: redeclaration of 'S' with no linkage
66 | return 0; char S[MAX];
| ^
mai... |
s264015236 | p02263 | C | #include <stdio.h>
int isempty();
void push(int *,int);
int pop(int *);
int top=0;
int main(){
int S[100];
int x;
int i;
int b,a;
for(i=0;i<100;i++){
if((scanf("%d",&x))==EOF) break;
if(x=='+' || x=='-' || x=='*'){
b=pop(S)
if(x=='+'){
b=b+pop(S);
}
else if... | main.c: In function 'main':
main.c:20:15: error: expected ';' before 'if'
20 | b=pop(S)
| ^
| ;
21 | if(x=='+'){
| ~~
|
s151665280 | p02263 | C | #include<string.h>
void push(int);
int pop();
int sum[1000];
int top;
int main(){
int x;
int top=0;
int po1,po2;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
po1=pop();
po2=pop();
push(po1+po2);
}
else if ( s[0] == '-' ){
po2=pop();
po1=pop();
... | main.c: In function 'main':
main.c:15:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
15 | while( scanf("%s", s) != EOF ){
| ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
1 | #include<string.h>
+++ |+#include <stdio.h>
... |
s610824722 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top,s[100];
void push(int x){
S[++top]=x;
}
int pop(){
top--;
returns[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 i... | main.c: In function 'push':
main.c:6:3: error: 'S' undeclared (first use in this function)
6 | S[++top]=x;
| ^
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'pop':
main.c:10:3: error: 'returns' undeclared (first use in this function)... |
s338645426 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top,s[100];
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 ... | main.c: In function 'push':
main.c:6:3: error: 'S' undeclared (first use in this function)
6 | S[++top]=x;
| ^
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'pop':
main.c:10:10: error: 'S' undeclared (first use in this function)
1... |
s256844355 | p02263 | C | #include <stdio.h>
#define STACK_SIZE 100
#define MAX 100
int stack[STACK_SIZE];
int stack_size = 0;
int pop()
{
if (stack_size <= 0) return 0;
return stack[--stack_size];
}
int push(int a)
{
stack[stack_size++] = a;
}
int is_digit(char *s)
{
if (*s == '+' || *s =='-') {
s++;
if (*s >= '0' && *s <= '9') ret... | main.c:100:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
100 | s++;
| ^~
main.c:101:25: error: expected identifier or '(' before '}' token
101 | }
| ^
main.c:102:25: error: expected identifie... |
s960055142 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int pop(void);
void push(int);
int top,S[100];
int main(){
int x;
char s[100];
int a,b;
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
a=pop();
b=pop();
push(a+b);
} else if ( s[0] == '-' ){
a=pop();
b=pop()... | main.c:41:1: error: expected identifier or '(' before '}' token
41 | }
| ^
main.c:46:1: error: expected identifier or '(' before '}' token
46 | }
| ^
|
s406615633 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int Pop(void);
void Push(int);
int prin = 0;
int stack[100];
int main()
{
int i,j,x;
char s[100];
while(1){
if(scanf("%s",s) == EOF)
break;
if(s[0] == '+')
i = Pop();
j = Pop();
Push(j + i);
}
else if(s[0] == '-')
{
i = Pop();
j = Pop();
Push(j - i);
}
el... | main.c: In function 'main':
main.c:26:1: error: 'else' without a previous 'if'
26 | else if(s[0] == '-')
| ^~~~
main.c: At top level:
main.c:43:8: error: expected declaration specifiers or '...' before string constant
43 | printf("%d\n",stack[prin];
| ^~~~~~
main.c:43:15: error: expected declar... |
s183248148 | p02263 | C | s[0] == '-' ){
a=pop();
b=pop();
push(b-a);
} else if ( s[0] == '*' ){
a=pop();
b=pop();
push(a*b);
}
}
printf("%d\n",n[top]);
return 0;
}
void push(int x){
top++;
n[top]=x;
}
int pop(){ | main.c:1:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
1 | s[0] == '-' ){
| ^~
main.c:5:7: error: expected identifier or '(' before 'else'
5 | } else if ( s[0] == '*' ){
| ^~~~
main.c:10:3: error: expected identifier or '(' before '}' token
10 | }
... |
s066205214 | p02263 | C | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN+1];
int head, tail, n;
void enqueue(P);
P dequeue(void);
int min(int,int);
int main(){
int elaps = 0, c;
int i, q,n,s;
P u;
scanf("%d %d", &n, &q);
for ( i = 1; i <= n; i++){
scanf("%s",... | main.c: In function 'main':
main.c:44:3: error: implicit declaration of function 'prointf'; did you mean 'printf'? [-Wimplicit-function-declaration]
44 | prointf("\n");
| ^~~~~~~
| printf
|
s215941309 | p02263 | C | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN+1];
int head, tail, n;
void enqueue(P);
P dequeue(void);
int min(int,int);
int main(){
int elaps = 0, c;
int i, q,n,s;
P u;
scanf("%d %d", &n, &q);
for ( i = 1; i <= n; i++){
scanf("%s",... | main.c: In function 'main':
main.c:44:3: error: implicit declaration of function 'prointf'; did you mean 'printf'? [-Wimplicit-function-declaration]
44 | prointf("\n");
| ^~~~~~~
| printf
|
s836673874 | p02263 | C | }
else{
S.num[top] = atoi(c);
top++;
}
}
printf("%d\n",sum[sep]);
return 0;
}
int Sum(a S,char c){
int i, sum = 0;
switch(c){
case 42:
sum = 1;
for(i = 0; i < top; i++) sum *= S.num[i];
return sum;
case 43:
for(i = 0; i < top; i++) sum += S.num[i];
return sum;
... | main.c:1:5: error: expected identifier or '(' before '}' token
1 | }
| ^
main.c:2:5: error: expected identifier or '(' before 'else'
2 | else{
| ^~~~
main.c:6:3: error: expected identifier or '(' before '}' token
6 | }
| ^
main.c:7:10: error: expected declaration specif... |
s158901861 | p02263 | C | #include <stdio.h>
int top, N[1000];
int pop(void);
void push(int);
int main()
{
int a,b;
char n[100];
top = 0;
while(scanf("%s",n) != EOF) {
switch(n[0]) {
case '+':
a=pop();
b=pop();
push(a+b);
break;
case '-':
b=pop();
a=pop();
push(a-b);
... | main.c: In function 'main':
main.c:29:13: error: expected ':' or '...' before ';' token
29 | case '*';
| ^
main.c:36:12: error: passing argument 1 of 'push' makes integer from pointer without a cast [-Wint-conversion]
36 | push(n);
| ^
| |
| ... |
s582756534 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int top, s[MAX];
void initialize();
int isEmpty();
int isFull();
void push(int);
char pop();
int main(){
int x, y;
char s[MAX];
initialize();#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int top, s[MAX];
void i... | main.c: In function 'main':
main.c:18:16: error: stray '#' in program
18 | initialize();#include<stdio.h>
| ^
main.c:18:17: error: 'include' undeclared (first use in this function)
18 | initialize();#include<stdio.h>
| ^~~~~~~
main.c:18:17: note: each undeclared iden... |
s279455705 | p02263 | C |
while(1){
c = getchar();
if(c>='0' && c<='9'){
num[i] = c - 48;
i++;
// printf("%d\n",i);
}
else if(c == ' ' && i>0){
if(i > 1){
for(j = 0; j < i-1; j++){
n = num[j]*10;
for(k=i-j-2;k > 0 ;k--){
n = n*10;
// printf("%d\n",n);
... | main.c:2:4: error: expected identifier or '(' before 'while'
2 | while(1){
| ^~~~~
main.c:57:13: error: expected declaration specifiers or '...' before string constant
57 | printf("%d\n",stack[max-1]);
| ^~~~~~
main.c:57:20: error: unknown type name 'stack'
57 | printf(... |
s677118273 | p02263 | C | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "problems.h"
struct stack_tag {
int32_t *data;
size_t max_len;
size_t size;
};
static bool check_is_null(const void *const p)
{
if (p == NULL) {
return true;
}
return false;
}
stack_t *stack_create(const size_t len)
{
int32_t *da... | main.c:5:10: fatal error: problems.h: No such file or directory
5 | #include "problems.h"
| ^~~~~~~~~~~~
compilation terminated.
|
s619194564 | p02263 | C | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
struct stack_tag {
int32_t *data;
size_t max_len;
size_t size;
};
static bool check_is_null(const void *const p)
{
if (p == NULL) {
return true;
}
return false;
}
stack_t *stack_create(const size_t len)
{
int32_t *data = (int32_t *)malloc(... | main.c:11:8: error: unknown type name 'bool'
11 | static bool check_is_null(const void *const p)
| ^~~~
main.c:4:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
3 | #include <stdlib.h>
+++ |+#include <stdbool.h>
4 |
main.c: In func... |
s516238390 | p02263 | C | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
struct stack_tag {
int32_t *data;
size_t max_len;
size_t size;
};
static bool check_is_null(const void *const p)
{
if (p == NULL) {
return true;
}
return false;
}
stack_t *stack_create(const size_t len)
{
int32_t *data... | main.c:21:1: error: unknown type name 'stack_t'
21 | stack_t *stack_create(const size_t len)
| ^~~~~~~
main.c: In function 'stack_create':
main.c:24:3: error: unknown type name 'stack_t'
24 | stack_t *stack = (stack_t *)malloc(sizeof(stack_t));
| ^~~~~~~
main.c:24:21: error: 'stack_t' undeclared (... |
s191870833 | p02263 | C | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct stack_tag struct_t;
struct stack_tag {
int32_t *data;
size_t max_len;
size_t size;
};
static bool check_is_null(const void *const p)
{
if (p == NULL) {
return true;
}
return false;
}
stack_t *stack_creat... | main.c:23:1: error: unknown type name 'stack_t'
23 | stack_t *stack_create(const size_t len)
| ^~~~~~~
main.c: In function 'stack_create':
main.c:26:3: error: unknown type name 'stack_t'
26 | stack_t *stack = (stack_t *)malloc(sizeof(stack_t));
| ^~~~~~~
main.c:26:21: error: 'stack_t' undeclared (... |
s476269319 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
??
int stack[100];
int count=0;
??
int pop()
{
????count--;
????return stack[count];
}
??
void push(int n)
{
????stack[count]=n;
????count++;
}
??
int main(void){
????int x,n,m;
????char s[100];
??????
????while( scanf("%s", s) != EOF ){
????????if ( s[0] == '+' )... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
main.c:7:1: error: expected identifier or '(' before '?' token
7 | ??
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ??
| ^
main.c:19:1: error: expected identifier or '(' before '?' token
... |
s031796727 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
??
int stack[100];
int count=0;
??
int pop()
{
????count--;
????return stack[count];
}
??
void push(int n)
{
????stack[count]=n;
????count++;
}
??
int main(void){
????int x,n,m;
????char s[100];
??????
????while( scanf("%s", s) != EOF ){
????????if ( s[0] == '+' )... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
main.c:7:1: error: expected identifier or '(' before '?' token
7 | ??
| ^
main.c:13:1: error: expected identifier or '(' before '?' token
13 | ??
| ^
main.c:19:1: error: expected identifier or '(' before '?' token
... |
s359698108 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
????int cal[100], top = 0;
????char s[1000000];
????while(1){
????????if(scanf("%s",&s) == EOF) break;
????????if(s[0] == '+'){
????????????cal[top-1] = cal[top-1] + cal[top];
????????????top--;
????????}
??
????????else if(s[0] == '-'){
????????????cal[top-1] = ... | main.c: In function 'main':
main.c:6:1: error: expected expression before '?' token
6 | ????int cal[100], top = 0;
| ^
main.c:7:1: error: expected expression before '?' token
7 | ????char s[1000000];
| ^
main.c:9:1: error: expected expression before '?' token
9 | ????while(1){
| ^
main.c:3... |
s410710406 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
int cal[100], top = 0;
char s[1000000];
while(1){
if(scanf("%s",&s) == EOF) break;
if(s[0] == '+'){
cal[top-1] = cal[top-1] + cal[top];
top--;
????????}
????????else if(s[0] == '-'){
cal[top-1] = cal[top-1] - cal[top];
top--;
????????}
else if(s[0] == '*'){
cal[top-1]... | main.c: In function 'main':
main.c:11:1: error: expected expression before '?' token
11 | ????????}
| ^
main.c:12:1: error: expected expression before '?' token
12 | ????????else if(s[0] == '-'){
| ^
main.c:22:1: error: expected expression before '?' token
22 | ????}
| ^
main.c:23:1: error: e... |
s367943253 | p02263 | C | #include<stdio.h>
#include<stdkib.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] == '-'){
b =... | main.c:2:9: fatal error: stdkib.h: No such file or directory
2 | #include<stdkib.h>
| ^~~~~~~~~~
compilation terminated.
|
s995032080 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int top,S[1000];
void push(int x)
{
S[++top] = x;
}
void pop()
{
top--;
return S[top+1];
}
int main()
{
int a,b;
char s[100];
top = 0;
while(scanf("%s",s) != EOF)
{
if(s[0] == '+')
{
a = pop();
b = pop();
push(a + b);
}
else if(... | main.c: In function 'pop':
main.c:15:17: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
15 | return S[top+1];
| ~^~~~~~~
main.c:12:6: note: declared here
12 | void pop()
| ^~~
main.c: In function 'main':
main.c:29:27: error: void value not igno... |
s555676973 | 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;
char s[100];
top=0;
while(scanf("%s",s)!=EOF){
if(s[0]=='+'){
a=pop();
b=pop();
push(a+b);
}else if(s[0]=='-'){
b=pop();
a=pop(... | main.c: In function 'main':
main.c:34:30: error: implicit declaration of function 'atio'; did you mean 'atoi'? [-Wimplicit-function-declaration]
34 | push(atio(s));
| ^~~~
| atoi
|
s434955819 | 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]=='-'){
b=pop();
a=pop(... | main.c: In function 'main':
main.c:34:30: error: implicit declaration of function 'atio'; did you mean 'atoi'? [-Wimplicit-function-declaration]
34 | push(atio(s));
| ^~~~
| atoi
|
s330828166 | 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(void){
int a,b;
char s[100];
top = 0;
while(scanf("%s",s) != EOF){
if(s[0] == '+'){
a = pop();
b = pop();
push(a+b);
}else if(s[0] == '-... | main.c: In function 'main':
main.c:41:9: error: expected declaration or statement at end of input
41 | return 0;
| ^~~~~~
|
s341512044 | 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;
char s[100;]
top=0;
while(scanf("%s",s)!=EOF){
if(s[0]=='+'){
a=pop();
b=pop();
push(a+b);
}else if(s[0]=='-'){
b=pop();
a=p... | main.c: In function 'main':
main.c:18:19: error: expected ']' before ';' token
18 | char s[100;]
| ^
| ]
main.c:21:26: error: 's' undeclared (first use in this function)
21 | while(scanf("%s",s)!=EOF){
| ^
main.c:21:26:... |
s020299884 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<stting.h>
int top, S[1000];
void push(int x) {
S[++top] = x;
}
int pop() {
top--;
return S[top + 1];//top????????????????????????top????????????????????????
}
int main() {
int a, b;
top = 0;
char s[100];
while (scanf("%s", s) != EOF) {
if (s[0] == '0') {
b ... | main.c:3:9: fatal error: stting.h: No such file or directory
3 | #include<stting.h>
| ^~~~~~~~~~
compilation terminated.
|
s523021964 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000
int top,S[1000];
initialize()
{
top=0;
}
isEmpty()
{
return top == 0;
}
isFull()
{
return top >= MAX-1;
}
int push(int x)
{
if isFull()
printf("error!\n");
int x;
S[++top] = x;
}
void pop()
{
if isEmpty()
printf("error!\n");
top--;
... | main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
8 | initialize()
| ^~~~~~~~~~
main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
12 | isEmpty()
| ^~~~~~~
main.c:16:1: error: return type defaults to 'int' [-Wimplicit-int]
16 | isFull()
| ^~~~~~
main.c: In fun... |
s590082622 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000
int top,S[1000];
initialize()
{
top=0;
}
isEmpty()
{
return top == 0;
}
isFull()
{
return top >= MAX-1;
}
int push(int x)
{
int x;
S[++top] = x;
}
void pop()
{
top--;
return S[top+1]
}
int main()
{
int i,a,b;
char s[100];
while(scanf... | main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
8 | initialize()
| ^~~~~~~~~~
main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
12 | isEmpty()
| ^~~~~~~
main.c:16:1: error: return type defaults to 'int' [-Wimplicit-int]
16 | isFull()
| ^~~~~~
main.c: In fun... |
s830329687 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int main(void) {
char siki[200];
int kazu[200], i = 0;
while (scanf_s("%s", siki) != EOF) {
switch (siki[0]) {
case '+':
kazu[i - 2] += kazu[i - 1];
i--;
break;
case '-':
kazu[i - 2] -= kazu[i - 1];
i--;
break;
case '*':
kazu[i - 2] *= kazu[i - 1... | main.c: In function 'main':
main.c:9:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
9 | while (scanf_s("%s", siki) != EOF) {
| ^~~~~~~
| scanf
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.