foo.cc: In function 'int main()':
foo.cc:12:19: error: 'malloc' was not declared in this scope
head = (pNode)malloc(sizeof(Node));
^~~~~~
foo.cc:14:18: error: 'NULL' was not declared in this scope
head->next = NULL;
^~~~
foo.cc:15:5: error: 'scanf' was not declared in this scope
scanf("%d", &n);
^~~~~
foo.cc:32:9: error: 'printf' was not declared in this scope
printf("%d ", p->data);
^~~~~~
foo.cc:32:9: note: suggested alternative: 'int'
printf("%d ", p->data);
^~~~~~
int
foo.cc:35:5: error: 'printf' was not declared in this scope
printf("%d", x);
^~~~~~
foo.cc:35:5: note: suggested alternative: 'int'
printf("%d", x);
^~~~~~
int
foo.cc:8:23: warning: unused variable 'q' [-Wunused-variable]
pNode head, p, s, q;
^
[Hydro](https://hydro.ac)提供评测服务