foo.cc: In function 'int main()':
foo.cc:6:24: error: 'cin' was not declared in this scope
6 | for(int i=1;i<=10;i++)cin>>apple[i];
| ^~~
foo.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
1 | #include<cstdio>
+++ |+#include <iostream>
2 |
foo.cc:7:10: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=]
7 | scanf("%d",h)
| ~^ ~
| | |
| | int
| int*
foo.cc:7:15: error: expected ';' before 'for'
7 | scanf("%d",h)
| ^
| ;
8 | for(i=1;i<=10;i++)
| ~~~
foo.cc:8:11: warning: statement has no effect [-Wunused-value]
8 | for(i=1;i<=10;i++)
| ~^~~~
foo.cc:8:19: error: expected ';' before ')' token
8 | for(i=1;i<=10;i++)
| ^
| ;
foo.cc:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
7 | scanf("%d",h)
| ~~~~~^~~~~~~~
[Hydro](https://hydro.ac)提供评测服务