Problem exam
User alettuce
Submission Time 2024-02-23 13:42:26
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam.cpp: In function ‘int main()’:
exam.cpp:7:5: error: expected ‘(’ before ‘x’
7 | if x == 1 {
| ^
| (
exam.cpp:9:4: error: ‘else’ without a previous ‘if’
9 | } else {
| ^~~~
exam.cpp:16:8: error: no match for ‘operator>>’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘int’)
16 | cout >> c;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
exam.cpp:16:8: note: candidate: ‘operator>>(int, int)’ <built-in>
16 | cout >> c;
| ~~~~~^~~~
exam.cpp:16:8: note: no known conversion for argument 1 from ‘std::ostream’ {aka ‘std::basic_ostream<char>’} to ‘int’
In file included from /usr/include/c++/9/string:56,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,