Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
????string number;
????????while(1){ 
????????????cin >> number;
????????????if( number == "0"){
????????????????break;
????????????}
????????????int x = 0;
????????????for(int i = 0;i<number.size();i++){
????????????????int num = number[i] -'0';
????????????????x +=num;
????????????cout << x << endl;
????????????}
????????}
?
????return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: expected primary-expression before '?' token
    5 | ????string number;
      | ^
a.cc:5:2: error: expected primary-expression before '?' token
    5 | ????string number;
      |  ^
a.cc:5:3: error: expected primary-expression before '?' token
    5 | ????string number;
      |   ^
a.cc:5:4: error: expected primary-expression before '?' token
    5 | ????string number;
      |    ^
a.cc:5:12: error: expected primary-expression before 'number'
    5 | ????string number;
      |            ^~~~~~
a.cc:5:11: error: expected ':' before 'number'
    5 | ????string number;
      |           ^~~~~~~
      |           :
a.cc:5:12: error: 'number' was not declared in this scope
    5 | ????string number;
      |            ^~~~~~
a.cc:5:18: error: expected ':' before ';' token
    5 | ????string number;
      |                  ^
      |                  :
a.cc:5:18: error: expected primary-expression before ';' token
a.cc:5:18: error: expected ':' before ';' token
    5 | ????string number;
      |                  ^
      |                  :
a.cc:5:18: error: expected primary-expression before ';' token
a.cc:5:18: error: expected ':' before ';' token
    5 | ????string number;
      |                  ^
      |                  :
a.cc:5:18: error: expected primary-expression before ';' token
a.cc:6:1: error: expected primary-expression before '?' token
    6 | ????????while(1){
      | ^
a.cc:6:2: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |  ^
a.cc:6:3: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |   ^
a.cc:6:4: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |    ^
a.cc:6:5: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |     ^
a.cc:6:6: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |      ^
a.cc:6:7: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |       ^
a.cc:6:8: error: expected primary-expression before '?' token
    6 | ????????while(1){
      |        ^
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:6:9: error: expected ':' before 'while'
    6 | ????????while(1){
      |         ^~~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'while'
    6 | ????????while(1){
      |         ^~~~~
a.cc:18:1: error: expected primary-expression before '?' token
   18 | ?
      | ^
a.cc:19:1: error: expected primary-expression before '?' token
   19 | ????return 0;
      | ^
a.cc:19:2: error: expected primary-expression before '?' token
   19 | ????return 0;
      |  ^
a.cc:19:3: error: expected primary-expression before '?' token
   19 | ????return 0;
      |   ^
a.cc:19:4: error: expected primary-expression before '?' token
   19 | ????return 0;
      |    ^
a.cc:19:5: error: expected primary-expression before 'return'
   19 | ????return 0;
      |     ^~~~~~
a.cc:19:5: error: expected ':' before 'return'
   19 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:19:5: error: expected primary-expression before 'return'
   19 | ????return 0;
      |     ^~~~~~
a.cc:19:5: error: expected ':' before 'return'
   19 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:19:5: error: expected primary-expression before 'return'
   19 | ????return 0;
      |     ^~~~~~
a.cc:19:5: error: expected ':' before 'return'
   19 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:19:5: error: expected primary-expression before 'return'
   19 | ????return 0;
      |     ^~~~~~
a.cc:19:5: error: expected ':' before 'return'
   19 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:19:5: error: expected primary-expression before 'return'
   19 | ????return 0;
      |     ^~~~~~
a.cc:19:5: error: expected ':' before 'return'
   19 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:19:5: error: expected primary-expression before 'return'
   19 | ????return 0;
      |     ^~~~~~