Problem addition
User zeemou
Submission Time 2023-11-12 12:28:21
Score 0
Max Time N/A
Max Memory N/A

Compile Error

addition.cpp:3:5: error: cannot declare ‘::main’ to be a global variable
3 | int main{
| ^~~~
addition.cpp:5:2: error: expected primary-expression before ‘int’
5 | int a,b;
| ^~~
addition.cpp:5:2: error: expected ‘}’ before ‘int’
addition.cpp:3:9: note: to match this ‘{’
3 | int main{
| ^
addition.cpp:7:7: error: ‘cin’ in namespace ‘std’ does not name a type
7 | std::cin >> a,b;
| ^~~
In file included from addition.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
addition.cpp:9:7: error: ‘cout’ in namespace ‘std’ does not name a type
9 | std::cout << a+b;
| ^~~~
In file included from addition.cpp:1:
/usr/include/c++/9/iostream:61:18: note: ‘std::cout’ declared here
61 | extern ostream cout; /// Linked to standard ou