실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘void push(Stack*, char)’: Main.cpp:11:30: error: ‘realloc’ was not declared in this scope 11 | stack->data = (char*)realloc(stack->data,++stack->maxSize); | ^~~~~~~ Main.cpp:2:1: note: ‘realloc’ is defined in header ‘<cstdlib>’; did you forget to ‘#include <cstdlib>’? 1 | #include<stdio.h> +++ |+#include <cstdlib> 2 | Main.cpp: In function ‘char pop(Stack*)’: Main.cpp:18:26: error: ‘realloc’ was not declared in this scope 18 | stack->data = (char*)realloc(stack->data,--stack->maxSize); | ^~~~~~~ Main.cpp:18:26: note: ‘realloc’ is defined in header ‘<cstdlib>’; did you forget to ‘#include <cstdlib>’? Main.cpp: In function ‘int calc(Stack*)’: Main.cpp:24:13: error: ‘atoi’ was not declared in this scope 24 | int a = atoi(pop(stack)); | ^~~~ Main.cpp: In function ‘int main()’: Main.cpp:44:13: error: cannot convert ‘char**’ to ‘char*’ 44 | sprintf(back,"%d%d+",a,b); | ^~~~ | | | char** In file included from /usr/include/features.h:486, from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/stdio.h:27, from Main.cpp:1: /usr/include/aarch64-linux-gnu/bits/stdio2.h:36:1: note: initializing argument 1 of ‘int sprintf(char*, const char*, ...)’ 36 | __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...)) | ^~~~~ Main.cpp:50:27: error: invalid conversion from ‘char*’ to ‘char’ [-fpermissive] 50 | push(&stack,back[i]); | ~~~~~~^ | | | char* Main.cpp:9:29: note: initializing argument 2 of ‘void push(Stack*, char)’ 9 | void push(Stack* stack,char data){ | ~~~~~^~~~ Main.cpp:42:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 42 | scanf("%d %d",&a,&b); | ~~~~~^~~~~~~~~~~~~~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.