submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s348486328 | p02263 | Java |
import java.util.Scanner;
class Main{
int[] a = new int[200];
int top;
Stack(){
top = 0;
}
void push(int x){
a[++top] = x;
}
int pop(){
return a[top--];
}
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
Stack stack = new Stack();
while(s... | Main.java:8: error: invalid method declaration; return type required
Stack(){
^
1 error
|
s698599476 | p02263 | Java |
import java.util.Scanner;
class Main{
int[] a = new int[200];
int top;
Stack(){
top = 0;
}
void push(int x){
a[++top] = x;
}
int pop(){
return a[top--];
}
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
Main stack = new Main();
while(std... | Main.java:8: error: invalid method declaration; return type required
Stack(){
^
1 error
|
s716374887 | p02263 | Java | package javaTest;
import org.apache.commons.lang.StringUtils;
import java.util.LinkedList;
import java.util.Scanner;
/**
* Created by Lenovo on 2017/6/30.
*/
public class Algorithm {
public static void main(String[] args){
// int n = 7;
// int list[] = {5,3,1,3,4,2,6};
// int result = getM... | Main.java:11: error: class Algorithm is public, should be declared in a file named Algorithm.java
public class Algorithm {
^
Main.java:3: error: package org.apache.commons.lang does not exist
import org.apache.commons.lang.StringUtils;
^
2 errors
|
s928838873 | p02263 | Java | package javaTest;
import java.util.LinkedList;
import java.util.Scanner;
/**
* Created by Lenovo on 2017/6/30.
*/
public class Algorithm {
public static void main(String[] args){
// int n = 7;
// int list[] = {5,3,1,3,4,2,6};
// int result = getMax(n,list);
// System.out.println(res... | Main.java:10: error: class Algorithm is public, should be declared in a file named Algorithm.java
public class Algorithm {
^
1 error
|
s541009905 | p02263 | Java | package javaTest;
import java.util.LinkedList;
import java.util.Scanner;
/**
* Created by Lenovo on 2017/6/30.
*/
public class Algorithm {
public static int top;
public static int[] s = new int[1000];
public static void main(String[] args){
// int n = 7;
// int list[] = {5,3,1,3,4,2,6};
/... | Main.java:10: error: class Algorithm is public, should be declared in a file named Algorithm.java
public class Algorithm {
^
1 error
|
s772464999 | p02263 | Java | package javaTest;
import java.util.LinkedList;
import java.util.Scanner;
/**
* Created by Lenovo on 2017/6/30.
*/
public class Algorithm {
public static int top;
public static int[] s = new int[1000];
public static void main(String[] args){
// int n = 7;
// int list[] = {5,3,1,3,4,2,6};
/... | Main.java:10: error: class Algorithm is public, should be declared in a file named Algorithm.java
public class Algorithm {
^
1 error
|
s414244682 | p02263 | Java | package javaTest;
import java.util.Scanner;
/**
* Created by Lenovo on 2017/6/30.
*/
public class Algorithm {
public static int top = 0;
public static int[] s = new int[1000];
public static void main(String[] args){
// int n = 7;
// int list[] = {5,3,1,3,4,2,6};
// int result = getM... | Main.java:8: error: class Algorithm is public, should be declared in a file named Algorithm.java
public class Algorithm {
^
1 error
|
s214009177 | p02263 | Java | public class Main {
char[] c;
int id;
int exp() {
int s = term();
if (id < c.length && '0' <= c[id] && c[id] <= '9') {
int t = term();
int op = operand();
return calc(s, t, op);
}
return s;
}
int term() {
int s = number();
if (id < c.length && '0' <= c[id] && c[id]... | Main.java:57: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:57: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s993270465 | p02263 | Java | import java.util.Scanner;
class Main{
String[] data = new String[200];
int num;
Stack(){
this.num = 0;
}
boolean push(String c){
if(this.isFull())
return false;
else{
this.data[++num] = c;
return true;
}
}
String pop(){
return this.data[num--];
}
boolean isFu... | Main.java:7: error: invalid method declaration; return type required
Stack(){
^
1 error
|
s428612486 | p02263 | Java | import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;
class Main{
public static void main(String[] args)throws Exception{
Scanner scanner = new Scanner(System.in);
Deque<Integer> stack = new ArrayDeque<>();
String[] line = scanner.nextLine().split(" ");
int a,... | Main.java:14: error: ')' expected
switch(line[i]{
^
Main.java:34: error: ')' or ',' expected
stack.offer(Interger.parseInt(line[i])
^
Main.java:36: error: illegal start of expression
})
^
3 errors
|
s480880542 | p02263 | Java | import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;
class Main{
public static void main(String[] args)throws Exception{
Scanner scanner = new Scanner(System.in);
Deque<Integer> stack = new ArrayDeque<>();
String[] line = scanner.nextLine().split(" ");
int a,... | Main.java:34: error: cannot find symbol
stack.offer(Interger.parseInt(line[i]));
^
symbol: variable Interger
location: class Main
1 error
|
s006498768 | p02263 | Java | package chapter4;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;
public class StackWithLib {
public StackWithLib() {
}
public static void main(String[] args) {
new StackWithLib().solve();
}
private Scanner sc;
private void solve() {
sc = new ... | Main.java:7: error: class StackWithLib is public, should be declared in a file named StackWithLib.java
public class StackWithLib {
^
1 error
|
s994004563 | p02263 | Java | import java.util.Scanner;
public class Stack {
static int top = 0;
static int[] num = new int[1000];
public static void push(int x){
num[++top] = x;
}
public static int pop(){
top--;
return num[top+1];
}
public static void main(String[] args) {
Scanner... | Main.java:3: error: class Stack is public, should be declared in a file named Stack.java
public class Stack {
^
1 error
|
s550017065 | p02263 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int stack[] = new int[1000];
Scanner scanner = new Scanner(System.in);
int counta = 0;
while (scanner.hasNext()) {
String sc = scanner.next();
System.out.println(sc);
if (sc.charAt(0) == '*') {
stack[counta - ... | Main.java:29: error: reached end of file while parsing
}
^
1 error
|
s313785295 | p02263 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int stack[] = new int[1000];
Scanner scanner = new Scanner(System.in);
int counta = 0;
String input[] = (scanner.nextLine()).split(" ");
for (int i = 0; i < input.length; i++) {
if (input[i].equals("*")) {
stack[... | Main.java:29: error: reached end of file while parsing
}
^
1 error
|
s778470382 | p02263 | Java | import java.util.*;
public class AOJ_stack{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str;
ArrayDeque<Integer> stack =new ArrayDeque<Integer>();
while (sc.hasNext()) {
str= sc.next();
if(str.equals("+")){
... | Main.java:2: error: class AOJ_stack is public, should be declared in a file named AOJ_stack.java
public class AOJ_stack{
^
1 error
|
s671086212 | p02263 | Java | import java.util.*;
public class AOJ_stack{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str;
ArrayDeque<Integer> stack =new ArrayDeque<Integer>();
while (sc.hasNext()) {
str= sc.next();
if(str.equals("+")){
... | Main.java:2: error: class AOJ_stack is public, should be declared in a file named AOJ_stack.java
public class AOJ_stack{
^
1 error
|
s928061307 | p02263 | Java | import java.util.*;
public class AOJ_stack{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str;
ArrayDeque<Integer> stack =new ArrayDeque<Integer>();
while (sc.hasNext()) {
str= sc.next();
if(str.equals("+")){
... | Main.java:2: error: class AOJ_stack is public, should be declared in a file named AOJ_stack.java
public class AOJ_stack{
^
1 error
|
s496438511 | p02263 | Java | import java.util.Scanner;
public class Aizu{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int[] stack = new int[100];
int now = 0;
while(scan.hasNext()){
String line = scan.next();
switch(line){
case "+":
stack[now - 2] += stack[now... | Main.java:2: error: class Aizu is public, should be declared in a file named Aizu.java
public class Aizu{
^
1 error
|
s709924915 | p02263 | Java | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
public class Main{
static InputReader ir;
static P... | Main.java:39: error: illegal start of expression
public static void main(String[] args) throws Exception {
^
1 error
|
s734252816 | p02263 | Java | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
public class Main{
static InputReader ir;
static P... | Main.java:20: error: incompatible types: Object cannot be converted to int
int a=stk.pollFirst();
^
Main.java:21: error: incompatible types: Object cannot be converted to int
int b=stk.pollFirst();
^
Main.java:25: error: incompatible types: Object cannot be converted to int... |
s202705259 | p02263 | Java | #include<stdio.h>
int push(int);
int pop(void);
int stack[100];
int stack_size=0;
int main(){
char s[100];
scanf("%[^\n]*s",s);
printf("%s=%d\n",s,calc(s));
return 0;
}
int pop(){
if(stack_size<=0)
return 0;
else
return stack[--stack_size];
}
int push(int n){
stack[stack_size++]=n;
}
i... | Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
int pop(void);
^
(use --enable-preview to enable unnamed classes)
Main.ja... |
s754449246 | p02263 | Java | #include <stdio.h>
#include <stdlib.h>
int main(){
char operand[100];
int *S;
int count=0;
int i,j,retrun;
int a;
while((scanf("%s ",&operand[count]))=!EOF){ count++; }
S = (int *)malloc(count * sizeof(int));
for(i=0;i<count;i++){
if(operand[i]==12+32||operand[i]==14+32||operand[i]==11+32){
... | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:6: error: class, interface, enum, or record expected
int *S;
^
Main.java:7: error: u... |
s304731750 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
public class A {
public static void main(String args[]) throws IOException {
BufferedReader ln = new BufferedReader(new InputStreamReader(System.in));
String[] str = ln.readLine().s... | Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s186645736 | p02263 | Java | #include<stdio.h>
#include<stdlib.h>
void push(int);
void pop(int);
int stack[50];
int arryN = 0;
int main(){
char input[50];
int bre1 = 0, bre2 = 0;
while(scanf("%50s",input) != EOF){
if(input[0] == '+'){
pop(1);
bre1++;
}
else if(input[0] == '-'){
pop(2);
bre1++;
}
... | Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:2: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
void pop(int);
... |
s785999644 | p02263 | Java | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int sento;
int data[1000];
void push(int);
int pop();
int main(){
int change1;
int change2;
char set[100];
sento = 0;
while(scanf("%s",set) != EOF){
if(set[0] == '+'){
change1 = pop();
change2 = pop();
push(change1 + change2);
... | Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:2: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:3: error: illegal character: '#'
#include<string.h>
^
Main.java:6: error: class, interface, ... |
s247441525 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;... | Main.java:7: error: class pop is public, should be declared in a file named pop.java
public class pop{
^
1 error
|
s625040932 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;... | Main.java:7: error: <identifier> expected
public class {
^
1 error
|
s081925864 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;... | Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args[]) throws IOException{
^
(use --enable-preview to enable unnamed classes)
1 error
|
s576056503 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
public class pop{
public static void main(String args[]) throws IOException{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
String[] str=buf.readLine().split("\\s... | Main.java:7: error: class pop is public, should be declared in a file named pop.java
public class pop{
^
1 error
|
s882272453 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
public class pop{
public static void main(String args[]) throws IOException{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
String[] str=buf.readLine().split("\\s... | Main.java:7: error: class pop is public, should be declared in a file named pop.java
public class pop{
^
1 error
|
s436295925 | p02263 | Java | package aoj;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
public class RoundRobinScheduling {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputSt... | Main.java:9: error: class RoundRobinScheduling is public, should be declared in a file named RoundRobinScheduling.java
public class RoundRobinScheduling {
^
1 error
|
s809059417 | p02263 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
public class A {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] str = br.readLine().sp... | Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s428464923 | p02263 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner (System.in);
int [] St = new int[100];
int index = 0;
int k;
while(scan.hasNext()){
String str = scan.next();
switch(str){
case '+':
index--;
St[index-1] += St[index];
break;
case... | Main.java:13: error: incompatible types: char cannot be converted to String
case '+':
^
Main.java:17: error: incompatible types: char cannot be converted to String
case '*':
^
Main.java:21: error: incompatible types: char cannot be converted to String
case '-':
^
3 errors
|
s269520318 | p02263 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner (System.in);
int [] St = new int[100];
int index = 0;
int k;
while(scan.hasNext()){
String str = scan.next();
switch(str){
case '+':
index--;
St[index-1] += St[index];
break;
case... | Main.java:13: error: incompatible types: char cannot be converted to String
case '+':
^
Main.java:17: error: incompatible types: char cannot be converted to String
case '*':
^
Main.java:21: error: incompatible types: char cannot be converted to String
case '-':
^
3 errors
|
s487181533 | p02263 | Java | import java.util.Stack;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class ReversePolish {
public static int pop(int[] data,int sp){
return data[--sp];
}
public static void push(int[] data,int sp,int value)
{
data[sp++] = value;
}
public static void main(S... | Main.java:5: error: class ReversePolish is public, should be declared in a file named ReversePolish.java
public class ReversePolish {
^
1 error
|
s804515081 | 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
| |
s753834151 | 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
| |
s254160003 | p02263 | C | #include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
char buffer[20];
int stac[100], stac_num = 0;
while (1)
{
if (!(cin >> buffer))
break;
else if (buffer[0] >= '1' && buffer[0] <= '9')
{
stac[stac_num] = atoi(buffer);
stac_num++;
}
else
{
switch (buffer[0])
{
cas... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s884853223 | 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... | main.c:1:8: 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/inclu... |
s419658762 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include<string.h>
int MAX=1000;
int top,S[1000];
}
void push(int x){
S[top]=x;
top++;
}
int isEmpty(){
return top==0;
}
int isFull(){
return top>=MAX-1;
}
int pop(){
top--;
return S[top+1];
}
int main(){
int a,b;
top =0;
... | main.c:8:3: error: expected identifier or '(' before '}' token
8 | }
| ^
main.c: In function 'main':
main.c:33:7: error: implicit declaration of function 'show' [-Wimplicit-function-declaration]
33 | show(S);
| ^~~~
|
s917527849 | p02263 | C | include <stdio.h>
#include <stdlib.h>
#include<string.h>
int MAX=1000;
int top,S[1000];
void show (int A[]){
for (int i = 0; i < top+1; i++) {
printf("stats " );
printf("%d\t",A[i]);
}
}
void push(int x){
S[++top]=x;
}
/* int isEmpty(){
return top==0;
}
int isFull(){
... | 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... |
s921936833 | p02263 | C | include <stdio.h>
#include <stdlib.h>
#include<string.h>
int MAX=1000;
int top,S[1000];
void show (int A[]){
for (int i = 0; i < top+1; i++) {
printf("stats " );
printf("%d\t",A[i]);
}
}
void push(int x){
S[++top]=x;
}
/* int isEmpty(){
return top==0;
}
int isFull(){
... | 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... |
s524588470 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include<string.h>
int MAX=1000;
int top,S[1000];
/*void show (int A[]){
for (int i = 0; i < top+1; i++) {
printf("stats " );
printf("%d\t",A[i]);
}
}
void push(int x){
S[++top]=x;
}
/* int isEmpty(){
return top==0;
}
int isFull(){
... | main.c: In function 'main':
main.c:41:10: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
41 | push(a+b);
| ^~~~
|
s029125993 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main()
{
char op[200]={};
int k[100],t=0,a,b;
while(scanf("%c",&op[i])!=EOF){
if(op[i]=='\0') break;
if ( isdigit((unsigned char)op[i]) ) {
k[t] = op[i]-'0';
t++;
printf(",%d t=%d\n",op[i]-'0',... | main.c: In function 'main':
main.c:9:26: error: 'i' undeclared (first use in this function)
9 | while(scanf("%c",&op[i])!=EOF){
| ^
main.c:9:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:38:21: error: 'flg' undeclared (first use ... |
s125266877 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main()
{
char op[200]={};
int k[100],t=0,a,b;
while(scanf("%c",&op[i])!=EOF){
if(op[i]=='\0') break;
if ( isdigit((unsigned char)op[i]) ) {
k[t] = op[i]-'0';
t++;
printf(",%d t=%d\n",op[i]-'0',... | main.c: In function 'main':
main.c:9:26: error: 'i' undeclared (first use in this function)
9 | while(scanf("%c",&op[i])!=EOF){
| ^
main.c:9:26: note: each undeclared identifier is reported only once for each function it appears in
|
s272482268 | p02263 | C | #include<stdio.h>
int thw(int,int);
void chng(char*,int*,int,int);
int thw(int s,int b)
{
for(int i=1;i<s;i++) b = b * 10;
return b;
}
void chng(char *box,int *A,int s,int cnt)
{
int tmp,bt=0;
for(int i=s-1;i>=0;i--)
{
tmp = box[i]-'0';
bt += thw(s-i,tmp);
}
A[cnt] = bt;
}... | main.c: In function 'main':
main.c:60:36: error: expected ';' before 's'
60 | if(flg == 0) cnt +=1
| ^
| ;
61 | s = 0;
| ~
|
s346943831 | p02263 | C | #include<stdio.h>
#define MAX 1000
int top;
int S[MAX];
void initialize(){
top=0;
}
void isempty(){
if(top==0)return;
}
void isfull(){
return top>MAX-1;
}
void pop(int n){
isfull()return;
top++;
S[top]=n;
}
int push(){
isempty()return;
... | main.c: In function 'isfull':
main.c:16:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
16 | return top>MAX-1;
| ~~~^~~~~~
main.c:15:6: note: declared here
15 | void isfull(){
| ^~~~~~
main.c: In function 'pop':
main.c:20:16: error: expected '... |
s316667511 | p02263 | C | #include<stdio.h>
#define MAX 1000
int top;
int S[MAX];
void initialize(){
return top=0;
}
void isempty(){
if(top==0)return;
}
void isfull(){
return top>MAX-1;
}
void push(int n){
if isfull(){return;}
top++;
S[top]=n;
}
int pop(){
if is... | main.c: In function 'initialize':
main.c:8:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
8 | return top=0;
| ~~~^~
main.c:7:6: note: declared here
7 | void initialize(){
| ^~~~~~~~~~
main.c: In function 'isfull':
main.c:16:18: error: 'retu... |
s148983006 | p02263 | C | #include<stdio.h>
#define MAX 1000
int top;
int S[MAX];
void initialize(){
return top=0;
}
void isempty(){
return top==0;
}
void isfull(){
return top>=MAX-1;
}
void push(int n){
if (isfull()){printf("overflow\n");}
top++;
S[top]=n;
}
int pop()... | main.c: In function 'initialize':
main.c:8:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
8 | return top=0;
| ~~~^~
main.c:7:6: note: declared here
7 | void initialize(){
| ^~~~~~~~~~
main.c: In function 'isempty':
main.c:12:18: error: 'ret... |
s931411829 | p02263 | C | #include<stdio.h>
#define MAX 1000
int top;
int S[MAX];
void initialize(){
return top=0;
}
void isempty(){
return top==0;
}
void isfull(){
return top>=MAX-1;
}
void push(int n){
if (isfull()){printf("overflow\n");exit(1);}
top++;
S[top]=n;
}
i... | main.c: In function 'initialize':
main.c:8:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
8 | return top=0;
| ~~~^~
main.c:7:6: note: declared here
7 | void initialize(){
| ^~~~~~~~~~
main.c: In function 'isempty':
main.c:12:18: error: 'ret... |
s178498492 | p02263 | C | #include<stdio.h>
#define MAX 1000
int top;
int S[MAX];
int initialize(){
return top=0;
}
int isempty(){
return top==0;
}
void isfull(){
return top>=MAX-1;
}
void push(int n){
if (isfull()){printf("overflow\n");exit(1);}
top++;
S[top]=n;
}
int... | main.c: In function 'isfull':
main.c:16:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
16 | return top>=MAX-1;
| ~~~^~~~~~~
main.c:15:6: note: declared here
15 | void isfull(){
| ^~~~~~
main.c: In function 'push':
main.c:20:12: error: void va... |
s940817239 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int stack[1000];
int kazu;
void push(int j){
stack[++kazu] = j;
}
int pop(){
kazu--;
return stack[kazu+1];
}
int main(){
int l,n;
kazu = 0;
char s[100];
while( scanf("%s", s)!=EOF){
if(s[0] == '+'){
l =pop();
n =pop();
pus... | main.c:4:1: error: stray '\302' in program
4 | <U+00A0>
| ^~~~~~~~
main.c:7:1: error: stray '\302' in program
7 | <U+00A0>
| ^~~~~~~~
main.c: In function 'push':
main.c:9:1: error: stray '\302' in program
9 | <U+00A0><U+00A0>stack[++kazu] = j;
| ^~~~~~~~
main.c:9:2: error: stray '\302' in ... |
s803139229 | p02263 | C | #include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int top, S[100];
void push(int x){
// topを加算してからその位置へ挿入
top++;
S[top] = x;
}
int pop(){
top--;
// topが指していた要素を返す
return S[top+1];
}
int main(){
int a, b;
top = 0;
char s[100];
... | main.c:1:10: fatal error: algorithm: No such file or directory
1 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s809403344 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | main.c: In function 'main':
main.c:27:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
27 | gets(s);
| ^~~~
| fgets
|
s725903714 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void add(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]+=num[*pa];
num[*pa]=0;
}
void minus(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]-=num[*pa];
num[*pa]=0;
}
void multiply(int num[],int *pa){
*pa=(*pa)-1;
num[(*pa)-1]*=num[*pa];
num[*pa]=0;
}
in... | main.c: In function 'main':
main.c:28:18: error: expected ';' before 'while'
28 | getchar()
| ^
| ;
29 | while(k--){
| ~~~~~
|
s795161776 | p02263 | C | #include <iostream>
#include <stack>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
stack <long> number;
char op;
long num;
bool flag=true;
while(scanf("%c",&op)!=EOF)
{
if(op>='0'&&op<='9')
{
if(flag==true)
{
nu... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s315321616 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include
#define MAX 100;
//グローバル変数
int top;
long int a[MAX];
//topの初期化
void initialize(){
top = 0;
}
//スタックが空かどうか
int isEmpty(int top){
if(top == 0){
return 1;
}
else{
return 0;
}
}
//スタックが満杯かどうか
int isFull(int top){
if(top >= MAX - 1){
return 1;
}
else{
return ... | main.c:3:9: error: #include expects "FILENAME" or <FILENAME>
3 | #include
| ^
main.c:5:16: error: expected ']' before ';' token
5 | #define MAX 100;
| ^
main.c:8:12: note: in expansion of macro 'MAX'
8 | long int a[MAX];
| ^~~
main.c: In function 'isFull':... |
s626147325 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100;
//グローバル変数
int top;
long int a[MAX];
//topの初期化
void initialize(){
top = 0;
}
//スタックが空かどうか
int isEmpty(int top){
if(top == 0){
return 1;
}
else{
return 0;
}
}
//スタックが満杯かどうか
int isFull(int top){
if(top >= MAX - 1){
return 1;
}
else{
return 0;
}
}
... | main.c:4:16: error: expected ']' before ';' token
4 | #define MAX 100;
| ^
main.c:7:12: note: in expansion of macro 'MAX'
7 | long int a[MAX];
| ^~~
main.c: In function 'isFull':
main.c:4:16: error: expected ')' before ';' token
4 | #define MAX 100;
| ... |
s012232710 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100
//グローバル変数
int top;
long int a[MAX];
//topの初期化
void initialize(){
top = 0;
}
//スタックが空かどうか
int isEmpty(int top){
if(top == 0){
return 1;
}
else{
return 0;
}
}
//スタックが満杯かどうか
int isFull(int top){
if(top >= MAX - 1){
return 1;
}
else{
return 0;
}
}
/... | main.c: In function 'main':
main.c:56:24: warning: comparison between pointer and integer
56 | if ( s == '+' ){
| ^~
main.c:62:29: warning: comparison between pointer and integer
62 | else if ( s == '-' ){
| ^~
main.c:6... |
s556577091 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100
//グローバル変数
int top;
long int a[MAX];
//topの初期化
void initialize(){
top = 0;
}
//スタックが空かどうか
int isEmpty(int top){
if(top == 0){
return 1;
}
else{
return 0;
}
}
//スタックが満杯かどうか
int isFull(int top){
if(top >= MAX - 1){
return 1;
}
else{
return 0;
}
}
/... | main.c: In function 'main':
main.c:81:31: error: too many arguments to function 'getchar'
81 | while(getchar(s[i]) != ' '){
| ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
582 | extern int getchar (void);
|... |
s090027573 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100
//グローバル変数
int top;
long int a[MAX];
//topの初期化
void initialize(){
top = 0;
}
//スタックが空かどうか
int isEmpty(int top){
if(top == 0){
return 1;
}
else{
return 0;
}
}
//スタックが満杯かどうか
int isFull(int top){
if(top >= MAX - 1){
return 1;
}
else{
return 0;
}
}
/... | main.c: In function 'main':
main.c:81:31: error: too many arguments to function 'getchar'
81 | while(getchar(s[i]) != ' '){
| ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
582 | extern int getchar (void);
|... |
s872960045 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100
//グローバル変数
int top;
long int a[MAX];
//topの初期化
void initialize(){
top = 0;
}
//スタックが空かどうか
int isEmpty(int top){
if(top == 0){
return 1;
}
else{
return 0;
}
}
//スタックが満杯かどうか
int isFull(int top){
if(top >= MAX - 1){
return 1;
}
else{
return 0;
}
}
/... | main.c: In function 'main':
main.c:81:31: error: too many arguments to function 'getchar'
81 | while(getchar(s[i]) != ' '){
| ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
582 | extern int getchar (void);
|... |
s407123519 | p02263 | C | #include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
typedef long ELEM; /* スタックの要素の型 */
#define STACK_SIZE 100 /* スタックの大きさ */
ELEM stack[STACK_SIZE]; /* スタックの定義 */
int n; /* スタックポインタ */
/* エラーメッセージをプリントしてexitする */
void error(char *s)
{
fprintf(stderr, s);
exit(1);
}
... | main.c:10:35: error: stray '\343' in program
10 | int n; <U+3000><U+3000><U+3000> /* <U+30B9><U+30BF><U+30C3><U+30AF><U+30DD><U+30A4><U+30F3><U+30BF> */
| ^~~~~~~~
main.c:10:37: error: stray '\343' in program
10 | int n; ... |
s997056746 | p02263 | C | #include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
typedef long ELEM; /* スタックの要素の型 */
#define STACK_SIZE 100 /* スタックの大きさ */
ELEM stack[STACK_SIZE]; /* スタックの定義 */
int n; /* スタックポインタ */
/* エラーメッセージをプリントしてexitする */
void error(char *s)
{
fprintf(stderr, s);
exit(1);
}
... | main.c:10:35: error: stray '\343' in program
10 | int n; <U+3000><U+3000><U+3000> /* <U+30B9><U+30BF><U+30C3><U+30AF><U+30DD><U+30A4><U+30F3><U+30BF> */
| ^~~~~~~~
main.c:10:37: error: stray '\343' in program
10 | int n; ... |
s388665215 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int top, S[1000];
void push(int x) {
/*topを加算してからその位置に値を挿入*/
S[++top] = x;
}
int pop() {
top--;
/*topが指していた要素を返す*/
return S[top + 1];
}
int main() {
int a, b;
char s[100];
top = 0;
while (scanf_s("%s", s, 100) != EOF) {
if (s[0] == '+') {
a = po... | main.c: In function 'main':
main.c:23:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
23 | while (scanf_s("%s", s, 100) != EOF) {
| ^~~~~~~
| scanf
|
s436828659 | p02263 | C | #include<stdio.h>
#include<assert.h>
#include<math.h>
#include<string.h>
int stack[100];
int top = 0;
void push(int v){
stack[top++] = v;
}
int pop(){
return stack[--top];
}
int getInt(char *s){
int i
int ret=0;
int size = strlen(s);
for(i=0;i<size;i++){
ret += (s[i]-'0')*pow(10... | main.c: In function 'getInt':
main.c:18:10: error: expected ';' before 'int'
18 | int i
| ^
| ;
19 | int ret=0;
| ~~~
main.c:22:9: error: 'i' undeclared (first use in this function)
22 | for(i=0;i<size;i++){
| ^
main.c:22:9: note: each undecl... |
s241333011 | p02263 | C | #include<stdio.h>
#include<assert.h>
#include<math.h>
#include<string.h>
int stack[100];
int top = 0;
void push(int v){
stack[top++] = v;
}
int pop(){
return stack[--top];
}
int getInt(char *s){
int i
int ret=0;
int size = strlen(s);
for(i=0;i<size;i++){
ret += (s[i]-'0')*pow(10... | main.c: In function 'getInt':
main.c:18:10: error: expected ';' before 'int'
18 | int i
| ^
| ;
19 | int ret=0;
| ~~~
main.c:22:9: error: 'i' undeclared (first use in this function)
22 | for(i=0;i<size;i++){
| ^
main.c:22:9: note: each undecl... |
s318451450 | p02263 | C | #include<stdio.h>
#include<assert.h>
#include<math.h>
#include<string.h>
int stack[110];
int top = 0;
void push(int v) {
stack[top++] = v;
}
int pop() {
return stack[--top];
}
int getInt(char *s){
int i, ret = 0;
int size = strlen(s);
for (i = 0; i<size; i++){
ret += (s[i] - '0')*pow(10, size - i - 1);
... | main.c: In function 'main':
main.c:30:16: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
30 | while (scanf_s("%s", s, 100) != EOF){
| ^~~~~~~
| scanf
|
s056195038 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
char s[16];
int S[100];
while (scanf("%s ",s)!=EOF){
int a,b,p=0;
if(s[0]<'.'){
a=S[--p];b=S[--p];
if(*s=='*')S[p++]=b*a;
else if(*s=='+')S[p++]=b+a;
else if(*s=='-')S[p++]=b-a;
}
else
push (atoi(s));
}
printf("%d... | main.c: In function 'main':
main.c:15:7: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
15 | push (atoi(s));
| ^~~~
main.c:17:22: error: 'p' undeclared (first use in this function)
17 | printf("%d\n", S[--p]);
| ^
main.c:17:22: note:... |
s520844484 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
//using namespace std;
void push(int x){
//top += 1;
S[++top] = x;
}
int pop(void){
top--;
return S[top + 1];
}
int main(){
int top, S[1000];
char s[100];
top = 0;
//initialize;
int a,b;
while(scanf("%s",s) != EOF){
//cout << "hoge" << endl... | main.c: In function 'push':
main.c:11:9: error: 'S' undeclared (first use in this function)
11 | S[++top] = x;
| ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:13: error: 'top' undeclared (first use in this function)
11 | ... |
s190540079 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
??
#define MAX 200
??
int sp = MAX;
int stack[MAX];
??
static void push(int a) {
????????if (sp > 0) {
????????????????stack[--sp] = a;
????????} else {
????????????????fprintf(stderr, "push error\n");
????????}
}
??
static int pop() {
????????if (sp < MAX) {
?... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
main.c:9:1: error: expected identifier or '(' before '?' token
9 | ??
| ^
main.c:17:1: error: expected identifier or '(' before '?' token
17 | ??
| ^
main.c:25:1: error: expected identifier or '(' before '?' token
... |
s024368518 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x,a[101],count=1;
char str[100];
while(scanf("%s",str) != EOF){
if(s[0]=='+'){
a[count-2] += a[count-1];
count--;
}
else if(s[0]=='-'){
a[count-2]-=a[count-1];
count--;
}
else if( s[0] == '*... | main.c: In function 'main':
main.c:10:8: error: 's' undeclared (first use in this function)
10 | if(s[0]=='+'){
| ^
main.c:10:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:19: error: 'b' undeclared (first use in this function)
31 | printf("%... |
s762354689 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x,a[101],count=1;
char str[100];
while(scanf("%s",str) != EOF){
if(s[0]=='+'){
a[count-2] += a[count-1];
count--;
}
else if(s[0]=='-'){
a[count-2]-=a[count-1];
count--;
}
else if( s[0] == '*... | main.c: In function 'main':
main.c:10:8: error: 's' undeclared (first use in this function)
10 | if(s[0]=='+'){
| ^
main.c:10:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:19: error: 'b' undeclared (first use in this function)
31 | printf("%... |
s508867823 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void push(int);
int pop(void);
int st[100];
int sp = 0;
int main(){
int x,j=0;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
} else if ( s[0] == '-' ){
} else if ( s[0] == '*' ){
} else {
if(s[j++] == '+' || s[... | main.c: In function 'main':
main.c:23:51: error: lvalue required as left operand of assignment
23 | if(s[j++] == '+' || s[j++] == '-' || s[j++] = '*'){
| ^
main.c:24:14: error: expected ';' before 'else'
24 | pop()
| ^
... |
s132242473 | p02263 | C | #include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
int x[100],top=0,i;
char s[100];
while(scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
top--;
x[top]=x[top]+x[top+1];
}
else if ( s[0] == '-' ){
top--;
x[top]=x[top]-x[top+1];
}
else if ( s[0] == '*' ){
... | main.c: In function 'main':
main.c:18:29: error: expected ';' before '}' token
18 | x[top]=x[top]*x[top+1]
| ^
| ;
19 | }
| ~
main.c:22:16: error: implicit declaration of function 'atoi' [-Wimplicit-fun... |
s766124215 | p02263 | C | #include<stdio.h>
#define N 100
int main(int argc, char *argv[]){
int i,j,a[N],b,c,d;
for(i=0;i<d-1;i++){
for(j=0;j<2;j++){
scanf("%d%d",a[j]a[j+1]);
}
if(scanf("%d",c)== +){
d = a[0] + a[1];
}
if(scanf("%d",c)== -){
d = a[0] - a[1];
} | main.c: In function 'main':
main.c:9:24: error: expected ')' before 'a'
9 | scanf("%d%d",a[j]a[j+1]);
| ~ ^
| )
main.c:11:23: error: expected expression before ')' token
11 | if(scanf("%d",c)== +){
| ^
main.c:14:23: error... |
s701761562 | p02263 | C | #include<stdio.h>
#define N 100
#define M 99
int main(int argc,char *argv[]){
int i,j,sum=0,k=0;
int S[N];
char t[M];
for(i=0;i<argc;i++){
scanf("%d",&S[i]);
push(S[i]);
if(S[i]== + || S[i]== - || S[i] == *){
sum = S[i-1]+S[i-2];
pop();
pop();
push(sum);
}
sum=0;... | main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'push' [-Wimplicit-function-declaration]
13 | push(S[i]);
| ^~~~
main.c:14:17: error: expected expression before '||' token
14 | if(S[i]== + || S[i]== - || S[i] == *){
| ^~
main.c:16:7: error: ... |
s874549564 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<stdring .h>
#define N 100
int
main(){
int x[],i=0;
char s[N];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
x[i-2]=x[i-2]+x[i-1];
i--;
} else if ( s[0] == '-' ){
x[i-2]=x[i-2]-x[i-1];
i--;
} else if ( s[0] == '*' ){
... | main.c:3:9: fatal error: stdring .h: No such file or directory
3 | #include<stdring .h>
| ^~~~~~~~~~~~
compilation terminated.
|
s749238193 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#define N 100
int
main(){
int x[],i=0;
char s[N];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
x[i-2]=x[i-2]+x[i-1];
i--;
} else if ( s[0] == '-' ){
x[i-2]=x[i-2]-x[i-1];
i--;
} else if ( s[0] == '*' ){
x[i-2]=x[i-2]*x[i-... | main.c: In function 'main':
main.c:9:7: error: array size missing in 'x'
9 | int x[],i=0;
| ^
|
s886736644 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 100;
int main(){
int y[N],i,x;
char s[N];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
y[i-2] = y[i-2] + y[i-1];
i--;
}
else if ( s[0] == '-' ){
y[i-2] = y[i-2] - y[i-1];
i--;
}
e... | main.c: In function 'main':
main.c:4:14: error: expected ']' before ';' token
4 | #define N 100;
| ^
main.c:8:9: note: in expansion of macro 'N'
8 | int y[N],i,x;
| ^
main.c:4:14: error: expected ']' before ';' token
4 | #define N 100;
| ^
main.c:9:10: n... |
s631027440 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 100;
int main(){
int y[N],i,x;
char s[N];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
y[i-2] = y[i-2] + y[i-1];
i--;
}
else if ( s[0] == '-' ){
y[i-2] = y[i-2] - y[i-1];
i--;
}
e... | main.c: In function 'main':
main.c:4:14: error: expected ']' before ';' token
4 | #define N 100;
| ^
main.c:8:9: note: in expansion of macro 'N'
8 | int y[N],i,x;
| ^
main.c:4:14: error: expected ']' before ';' token
4 | #define N 100;
| ^
main.c:9:10: n... |
s698465878 | p02263 | C | void push(int);
int pop(void);
main(){
int x, a, b;
char s[1000000];
while(scanf("%s", s) != EOF){
switch(s[0]){
case '+':
a = pop();
b = pop();
top++;
operands[top] = a + b;
break;
case '-':
a = pop();
b = pop();
top++;
operands[top] = b ... | main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
4 | main(){
| ^~~~
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 '<stdio.h>' or ... |
s719334054 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int x[100], i = 0;
char s[100];
while( scanf("%s", s) != EOF ){
if ( s[0] == '+' ){
x[i-1] = x[i-1] + x[i];
i--;
}
else if ( s[0] == '-' ){
x[i-1] = x[i-1] - x[i];
i--;
}
else if ( s[0] == '*' ){
... | main.c: In function 'main':
main.c:28:3: error: expected declaration or statement at end of input
28 | return 0;
| ^~~~~~
|
s083528618 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int top = 0;
int stack[200];
void push(int);
int pop(void);
int main() {
char x;
int a, b, c;
while(1){
if(scanf("%c", &x) == EOF)
break;
//push
else if(x >= 0 && x <= 9){
push( atoi(&x) );
}
//演算子の場合
else{
a = pop();
b = ... | main.c: In function 'main':
main.c:31:7: error: 'else' without a previous 'if'
31 | else if(&x == "-")
| ^~~~
main.c:34:7: error: 'else' without a previous 'if'
34 | else
| ^~~~
|
s159918186 | p02263 | C | x#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define MAX 100
void initialize();
int isEmpty();
int isFull();
int push(int);
int pop();
void plus();
void minus();
void times();
int S[100],top;
int main (){
char x;
int i;
initialize();
for(i=0;i<100;i++){
if(scanf("%c",&x) == EOF) break;
... | main.c:1:2: error: stray '#' in program
1 | x#include <stdio.h>
| ^
main.c:1:1: error: unknown type name 'x'
1 | x#include <stdio.h>
| ^
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | x#include <stdio.h>
| ^
In file included from main.c... |
s906027919 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 101
void initialize();
int Empty();
int Full();
void push(int);
int pop();
int n[MAX],top;
int main(){
char m[MAX];
int a,b;
initialize();
while(scanf("%s", m) != EOF){
if(m[0] == '+'){
b = pop();
a = pop();
push(a+b);
}
else ... | main.c: In function 'push':
main.c:56:6: error: type of 'x' defaults to 'int' [-Wimplicit-int]
56 | void push(x){
| ^~~~
main.c:62:12: error: 'm' undeclared (first use in this function)
62 | n[top] = m;
| ^
main.c:62:12: note: each undeclared identifier is reported only once for each... |
s086725064 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 101
void initialize();
int Empty();
int Full();
void push(int);
int pop();
int n[MAX],top;
int main(){
char m[MAX];
int a,b;
initialize();
while(scanf("%s", m) != EOF){
if(m[0] == '+'){
b = pop();
a = pop();
push(a+b);
}
else ... | main.c: In function 'push':
main.c:56:6: error: type of 'x' defaults to 'int' [-Wimplicit-int]
56 | void push(x){
| ^~~~
main.c:62:12: error: 'm' undeclared (first use in this function)
62 | n[top] = m;
| ^
main.c:62:12: note: each undeclared identifier is reported only once for each... |
s384515810 | p02263 | C | #include<stdio.h>
#define STACK_MAX 100
int push(int);
int pop(void);
int cal(char);
int stack[STACK_MAX];
int top=0;
main(){
char S[200];
scanf("%s",S);
printf("%d",cal(S));
return 0;
}
int cal(char S[]){
int i,a,b;
for(i=0;S[i] !='\0';i++){
switch(S[i]){
case '+':
a = pop();
b ... | main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
12 | main(){
| ^~~~
main.c: In function 'main':
main.c:15:19: error: passing argument 1 of 'cal' makes integer from pointer without a cast [-Wint-conversion]
15 | printf("%d",cal(S));
| ^
| |... |
s926792084 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
int stack[101], s_top = 0, x, i;
char n;
while ((scanf("%s" ,&n) != EOF){
if(n == '+'){
s_top -= 1;
x = stack[s_top];
x += stack[s_top + 1];
}
else if(n == '-'){
s_top -= 1;
x = stack[s_top];
x -= stack[s_top + 1]... | main.c: In function 'main':
main.c:8:34: error: expected ')' before '{' token
8 | while ((scanf("%s" ,&n) != EOF){
| ~ ^
| )
main.c:34:1: error: expected expression before '}' token
34 | }
| ^
|
s026291134 | p02263 | C | int top = 0;
void push(int x) {
top++;
ope[top] = x;
}
int pop() {
top--;
return ope[top+1];
}
int main() {
int a,b = 0;
int result;
int c;
int d,e;
while(scanf("%s",com) != EOF) {
if(com[0] == '+'){
push(pop() + pop());
}
else if(com[0] == '-'){
d... | main.c: In function 'push':
main.c:5:3: error: 'ope' undeclared (first use in this function)
5 | ope[top] = x;
| ^~~
main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'pop':
main.c:12:10: error: 'ope' undeclared (first use in this functi... |
s845181831 | p02263 | C |
}
int pop(){
top--;
return s[top+1];
}
int main(){
char a[8];
int c,b;
while(scanf("%s",a)!=EOF){
if(a[0]=='+')push(pop()+pop());
else if(a[0]=='-'){
c=pop();
b=pop();
push(b-c);}
else if(a[0]=='*')push(pop()*pop());
else push(atoi(a));
}
printf("%d\n",pop()); | main.c:2:1: error: expected identifier or '(' before '}' token
2 | }
| ^
main.c: In function 'pop':
main.c:4:3: error: 'top' undeclared (first use in this function); did you mean 'pop'?
4 | top--;
| ^~~
| pop
main.c:4:3: note: each undeclared identifier is reported only once for each fun... |
s848075067 | p02263 | C | #include <stdio.h>
#include <stdlib.h>
int o[101];
char c[100];
int top = 0;
void push(int x) {
top++;
o[top] = x;
}
int pop() {
top--;
return o[top+1];
}
int main() {
int a,b = 0;
int result;
int c;
int d,e;
while(scanf("%s",c) != EOF) {
if(c[0] == '+'){
... | main.c: In function 'main':
main.c:33:9: error: subscripted value is neither array nor pointer nor vector
33 | if(c[0] == '+'){
| ^
main.c:36:14: error: subscripted value is neither array nor pointer nor vector
36 | else if(c[0] == '-'){
| ^
main.c:40:16: error: subscripte... |
s828564324 | p02263 | C | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ... | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + + + + + + + + + + + + + + + + + + + + + ... |
s103533766 | p02263 | C | #include <iostream>
#include <cstdlib>
template <typename T>
class stack{
T a[101];
unsigned n;
public:
stack():a(),n(0){}
T& top(){return a[n-1];}
T pop(){return a[--n];}
void push(T in){a[n++]=in;}
};
int main(){
std::ios::sync_with_stdio(false);
stack<int> s;
char buf[100];
while(std::cin >> b... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s016053475 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
??
int main(){
????int x, stack[100], i=0;
????char s[100];
??????
????while( scanf("%s", s) != EOF ){
????????if ( s[0] == '+' ){
????????????stack[i-2] = stack[i-2] + stack[i-1];
????????????i -= 1;
????????} else if ( s[0] == '-' ){
????????????stack[i-2] = sta... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
|
s374825645 | p02263 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
??
int main(){
????int x, stack[100], i=0;
????char s[100];
??????
????while( scanf("%s", s) != EOF ){
????????if ( s[0] == '+' ){
????????????stack[i-2] = stack[i-2] + stack[i-1];
????????????i -= 1;
????????} else if ( s[0] == '-' ){
????????????stack[i-2] = sta... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
|
s960855002 | p02263 | C | #include <stdio.h>
#define Max 1000
int top = 0;
int isEmpty( ) {
return top == 0;
}
int isFull( ) {
return top >= Max -1;
}
void push(int stack[Max], int value) {
if (isFull( )) {
printf("error\n");
exit(1);
}
stack[++top] = value;
}
int pop(int stack[Max]) {
if (isEmpty( )) {
printf("error\n");
ex... | main.c: In function 'push':
main.c:17:17: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
17 | exit(1);
| ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
1 | #include <stdio.h>
+++ |+#include <stdlib.h>
2 ... |
s631781395 | p02263 | C | #include <stdio.h>
#define Max 1000
int top = 0;
int isEmpty( ) {
return top == 0;
}
int isFull( ) {
return top >= Max -1;
}
void push(int stack[Max], int value) {
if (isFull( )) {
printf("error\n");
exit(1);
}
stack[++top] = value;
}
int pop(int stack[Max]) {
if (isEmpty( )) {
printf("error\n");
ex... | main.c: In function 'push':
main.c:17:17: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
17 | exit(1);
| ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
1 | #include <stdio.h>
+++ |+#include <stdlib.h>
2 ... |
s288832034 | 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(int x)
{
top--;
//top??????????????????????´??????????
return S[top+1];
}
int main(){
int a,b;
top =0;
char s[100];
while(scanf("%s", s)... | main.c: In function 'main':
main.c:27:29: error: too few arguments to function 'pop'
27 | a = pop();
| ^~~
main.c:13:5: note: declared here
13 | int pop(int x)
| ^~~
main.c:28:29: error: too few arguments to function 'pop'
28 | ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.