Problem duckhunt4
User Jasper123
Submission Time 2026-05-01 12:34:33
Score 0
Max Time N/A
Max Memory N/A

Compile Error

duckhunt4.cpp: In function ‘int main()’:
duckhunt4.cpp:6:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
6 | cin>>x;
| ^~~
| std::cin
In file included from duckhunt4.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
duckhunt4.cpp:9:18: error: expected primary-expression before ‘>’ token
9 | if(x-500=>0){
| ^
duckhunt4.cpp:14:21: error: expected primary-expression before ‘>’ token
14 | else if(x-5=>0){
| ^
duckhunt4.cpp:37:5: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
37 | cout<<happiness;
| ^~~~
| std::cout
In file included from duckhunt4.cpp:1:
/usr/include/c++/9/iostream:61:18: note: ‘std::cout’ declared here