Problem sumofdigits
User CheeseAndBread
Submission Time 2025-01-27 15:28:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumofdigits.cpp: In function ‘int main()’:
sumofdigits.cpp:5:2: error: ‘cin’ was not declared in this scope
5 | cin.tie(0); ios_base::sync_with_stdio(0);
| ^~~
sumofdigits.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
+++ |+#include <iostream>
1 | using namespace std;
sumofdigits.cpp:5:14: error: ‘ios_base’ has not been declared
5 | cin.tie(0); ios_base::sync_with_stdio(0);
| ^~~~~~~~
sumofdigits.cpp:7:2: error: ‘string’ was not declared in this scope
7 | string n;
| ^~~~~~
sumofdigits.cpp:1:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
+++ |+#include <string>
1 | using namespace std;
sumofdigits.cpp:9:9: error: ‘n’ was not declared in this scope
9 | cin >> n;
| ^
sumofdigits.cpp:14:2: error: ‘cout’ was not