foo.cc:3:1: error: expected identifier before ‘int’
3 | int main()
| ^~~
foo.cc:2:16: error: expected ‘;’ before ‘int’
2 | using namespace
| ^
| ;
3 | int main()
| ~~~
foo.cc: In function ‘int main()’:
foo.cc:6:3: error: expected initializer before ‘cin’
6 | cin>>n>>sum;
| ^~~
foo.cc:7:3: error: ‘while(n’ was not declared in this scope
7 | while(n)
| ^~~~~~~~
foo.cc:12:4: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
12 | cout<<sum;
| ^~~~
| std::cout
In file included from stdc++.h:146:
/nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/iostream:63:18: note: ‘std::cout’ declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
foo.cc:12:10: error: ‘sum’ was not declared in this scope
12 | cout<<sum;
| ^~~
foo.cc:5:7: warning: unused variable ‘n’ [-Wunused-variable]
5 | int n,sum;
| ^