Problem addition
User roycedaboss
Submission Time 2025-06-16 14:11:43
Score 0
Max Time N/A
Max Memory N/A

Compile Error

addition.cpp:1:5: error: cannot declare ‘::main’ to be a global variable
1 | int main {
| ^~~~
addition.cpp:2:1: error: expected primary-expression before ‘int’
2 | int a = 10;
| ^~~
addition.cpp:2:1: error: expected ‘}’ before ‘int’
addition.cpp:1:10: note: to match this ‘{’
1 | int main {
| ^
addition.cpp:4:1: error: ‘cin’ does not name a type
4 | cin >> a;
| ^~~
addition.cpp:5:1: error: ‘cin’ does not name a type
5 | cin >> b;
| ^~~
addition.cpp:6:11: error: ‘a’ was not declared in this scope
6 | int sum = a + b;
| ^
addition.cpp:7:1: error: ‘cout’ does not name a type
7 | cout << a+b;
| ^~~~
addition.cpp:8:1: error: expected declaration before ‘}’ token
8 | }
| ^