실행 실패 (제출 코드 컴파일 에러)
Main.c:5:5: error: unknown type name ‘Node’ 5 | Node* next; | ^~~~ Main.c: In function ‘insert’: Main.c:12:16: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘char **’ [-Wformat=] 12 | scanf("%d %s",&newNode->age,newNode->name); | ~^ ~~~~~~~~~~~~~ | | | | char * char ** Main.c:14:13: error: ‘*head’ is a pointer; did you mean to use ‘->’? 14 | if(*head->age >= newNode->age){ | ^~ | -> Main.c:15:23: warning: assignment to ‘int *’ from incompatible pointer type ‘Node *’ [-Wincompatible-pointer-types] 15 | newNode->next = *head; | ^ Main.c:22:21: error: request for member ‘age’ in something not a structure or union 22 | if(tmp->next->age >= newNode->age){ | ^~ Main.c:24:23: warning: assignment to ‘int *’ from incompatible pointer type ‘Node *’ [-Wincompatible-pointer-types] 24 | tmp->next = newNode; | ^ Main.c:27:13: warning: assignment to ‘Node *’ from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types] 27 | tmp = tmp->next; | ^ Main.c:29:17: error: ‘NewNode’ undeclared (first use in this function); did you mean ‘newNode’? 29 | tmp->next = NewNode; | ^~~~~~~ | newNode Main.c:29:17: note: each undeclared identifier is reported only once for each function it appears in Main.c: In function ‘print’: Main.c:34:21: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘char **’ [-Wformat=] 34 | printf("%d %s",head->age,head->name); | ~^ ~~~~~~~~~~ | | | | char * char ** Main.c:35:14: warning: assignment to ‘Node *’ from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types] 35 | head = head->next; | ^ Main.c: In function ‘main’: Main.c:44:32: error: ‘newNode’ undeclared (first use in this function); did you mean ‘Node’? 44 | scanf("%d %s",&(head->age),newNode->name); | ^~~~~~~ | Node Main.c: In function ‘insert’: Main.c:12:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d %s",&newNode->age,newNode->name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main.c: In function ‘main’: Main.c:41:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 41 | scanf("%d",&N); | ^~~~~~~~~~~~~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.