criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,n;
    while(1){
        cin >> x;
        int y=x-'0';
        if(x==0)break;
        else{
            int a,b,c,d,s,t,u,sum;
            a=y%10;
            s=y-a;
            b=(s%100)/10;
            t=s-b*10;
            c=(y%1000)/10;
            u=t-c*100;
            d=u/1000;
            sum=a+b+c+d;
            
        }
        cout << sum << endl;
    }
    retrn 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'sum' was not declared in this scope
   21 |         cout << sum << endl;
      |                 ^~~
a.cc:23:5: error: 'retrn' was not declared in this scope
   23 |     retrn 0;
      |     ^~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char num[1001] ={};
    while(1){
        scanf("%s", num);
        if(num == '0') break;
        int sum = 0;
        for (int i = 0; city[i] != '\0'; i++){
            sum += city[i] - '0'
        }
        printf("%s\n",sum)
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(num == '0') break;
      |            ~~~~^~~~~~
a.cc:10:25: error: 'city' was not declared in this scope
   10 |         for (int i = 0; city[i] != '\0'; i++){
      |                         ^~~~
a.cc:13:27: error: expected ';' before '}' token
   13 |         printf("%s\n",sum)
      |                           ^
      |                           ;
   14 |     }
      |     ~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char num[1001] ={};
    while(1){
        scanf("%s", num);
        if(num == '0') break;
        int sum = 0;
        for (int i = 0; num[i] != '\0'; i++){
            sum += num[i] - '0'
        }
        printf("%s\n",sum)
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(num == '0') break;
      |            ~~~~^~~~~~
a.cc:11:32: error: expected ';' before '}' token
   11 |             sum += num[i] - '0'
      |                                ^
      |                                ;
   12 |         }
      |         ~                       
a.cc:13:27: error: expected ';' before '}' token
   13 |         printf("%s\n",sum)
      |                           ^
      |                           ;
   14 |     }
      |     ~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char num[1001] ={};
    while(1){
        scanf("%s", num);
        if(num == '0') break;
        int sum = 0;
        for (int i = 0; num[i] != '\0'; i++){
            sum += num[i] - '0';
        }
        printf("%s\n",sum);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(num == '0') break;
      |            ~~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,n;
    while(1){
        cin >> x;
        int y=x-'0';
        if(x==0)break;
        else{
            int a,b,c,d,s,t,u,sum;
            a=y%10;
            s=y-a;
            b=(s%100)/10;
            t=s-b*10;
            c=(y%1000)/10;
            u=t-c*100;
            d=u/1000;
            sum=a+b+c+d;
            cout << sum << endl;
        }

    }
    retrn 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'retrn' was not declared in this scope
   23 |     retrn 0;
      |     ^~~~~
Language: C++

#include<cstdio>;
//入出力を行う関数が使える(scanf,printf)//
#include<cctype>;
//文字の種類の判定や文字の変換を行う関数が使える//

int main(){
    char str[1001];
    
    while(true){
        scanf("%s",str);
        if (str[0]=='0') break;
        int sum = 0;
        //sumの初期化//
        for (int i=0; i<strlen(str); i++){
            //文字列strの長さを返す//
            sum += (str[i]-'0');
            //0の文字コードを引いている（0=48になっている)//
        }
        printf("%d\n",sum);
    }
    return 0;
}


Compiler output:
a.cc:1:17: warning: extra tokens at end of #include directive
    1 | #include<cstdio>;
      |                 ^
a.cc:3:17: warning: extra tokens at end of #include directive
    3 | #include<cctype>;
      |                 ^
a.cc: In function 'int main()':
a.cc:14:25: error: 'strlen' was not declared in this scope
   14 |         for (int i=0; i<strlen(str); i++){
      |                         ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<cctype>;
  +++ |+#include <cstring>
    4 | //文字の種類の判定や文字の変換を行う関数が使える//
Language: C++

#include<iostream>
#include<cstio>
using namespace std;
int main(){
    char ch;
    while(1){
        scanf("%c",&ch);
        int num;
        num =ch[i]-'0';
        
        if(ch=='0'){
            break;
        }
         
    }
    
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: cstio: No such file or directory
    2 | #include<cstio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char num[1001];
    while(1){
        scanf("%s", num);
        if(num[0] == '0') break;
        int sum = 0;
        for (int i = 0; strlen(num) > i; i++){
            sum += num[i] - '0';
        }
        printf("%s\n",sum);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'strlen' was not declared in this scope
   10 |         for (int i = 0; strlen(num) > i; i++){
      |                         ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
    
    char num[1001];
    
    while(1) {
        
        cin >> num;
        
        if (num == 0) break;
        
        int sum;
        
        for (i = 0; i < 1001; i ++) {
            
            sum += num[i] - '0';
            
        }
        
        cout << sum << endl;
        
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'i' was not declared in this scope
   16 |         for (i = 0; i < 1001; i ++) {
      |              ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
    
    
    
    while(1) {
        
        char num[1001];
        
        cin >> num;
        
        if (num == '0') break;
        
        int sum;
        
        for (int i = 0; i < 1001; i ++) {
            
            sum += num[i] - '0';
            
        }
        
        cout << sum << endl;
        
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         if (num == '0') break;
      |             ~~~~^~~~~~
Language: C++

#include<iostream>
#include<cstio>
using namespace std;
int main(){
    int i=0,ch;
    while(1){
        scanf("%c",&ch);
        i=i+ch;
        if(ch==0){
            break;
        }
         
    }
    printf("%c",i);
    
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: cstio: No such file or directory
    2 | #include<cstio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<cctype>
int main(){
    int x;
    int a=0;
    while(1){
        scanf("%d", &x);
        a += x
        if(x == '\n')break;
    }
    printf("%d",a);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected ';' before 'if'
    8 |         a += x
      |               ^
      |               ;
    9 |         if(x == '\n')break;
      |         ~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    char num[4] = "9999";
    
    int S;
    
    while(1){
        scanf(%s, num);
        
        if(num[0] == '0')break;
        
        for(int i = 0; i => 0; i++){
            if(num[i] == ¥0)break;
            
            S += (num[i] - '0');
        }
        
        cout << S << endl;
        
    }
}


Compiler output:
a.cc:14:26: error: extended character ¥ is not valid in an identifier
   14 |             if(num[i] == ¥0)break;
      |                          ^
a.cc: In function 'int main()':
a.cc:4:19: error: initializer-string for 'char [4]' is too long [-fpermissive]
    4 |     char num[4] = "9999";
      |                   ^~~~~~
a.cc:9:15: error: expected primary-expression before '%' token
    9 |         scanf(%s, num);
      |               ^
a.cc:9:16: error: 's' was not declared in this scope
    9 |         scanf(%s, num);
      |                ^
a.cc:13:27: error: expected primary-expression before '>' token
   13 |         for(int i = 0; i => 0; i++){
      |                           ^
a.cc:14:26: error: '\U000000a50' was not declared in this scope
   14 |             if(num[i] == ¥0)break;
      |                          ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int i=0,ch;
    while(1){
        cin>>ch
        i=i+ch;
        if(ch=0){
            break;
        }
         
    }
    cout<<i<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected ';' before 'i'
    6 |         cin>>ch
      |                ^
      |                ;
    7 |         i=i+ch;
      |         ~
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main() {
    
    
    
    while(1) {
        
        char num[1001];
        
        cin >> num;
        
        if (num[0] == '0') break;
        
        int sum;
        
        for (int i = 0; i < num.size(); i ++) {
            
            sum += num[i] - '0';
            
        }
        
        cout << sum << endl;
        
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: request for member 'size' in 'num', which is of non-class type 'char [1001]'
   19 |         for (int i = 0; i < num.size(); i ++) {
      |                                 ^~~~
Language: C++

#include<cstdio>
#include<cctype>
int main(){
    int x;
    int a=0;
    while(1){
        if(x == "\n"){
            printf("%d", a)
            int a =0;
        }
        scanf("%d", &x);
        a += x;
        if(x == 0)break;
        
    }
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(x == "\n"){
      |            ~~^~~~~~~
a.cc:8:28: error: expected ';' before 'int'
    8 |             printf("%d", a)
      |                            ^
      |                            ;
    9 |             int a =0;
      |             ~~~
Language: C++

#include<cstdio>
#include<cctype>
int main(){
    int x;
    int a=0;
    while(1){
        if(x == "\n"){
            printf("%d", a);
            int a =0;
        }
        scanf("%d", &x);
        a += x;
        if(x == 0)break;
        
    }
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(x == "\n"){
      |            ~~^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){   //x=0のとき終わり
    char x[];    //文字列を作成
    int sum = 0;
    
    while(1){
        scanf("%s",x);
        if(x == 0) break; //x=0のとき終わり
        
        for(int i = 0 ; x[i] != '\0'; i++){  //文字列に入力されたやつの末端まで読み込む 末端文字は\0と表す
            //printf("%d",x[i]," ");
            sum += x[i];
        }
        printf("%d",sum);
        printf("\n");
    }
    
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: storage size of 'x' isn't known
    5 |     char x[];    //文字列を作成
      |          ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch='A';
    int num,i;
    while(true){
        scanf("%s",&ch);
        if(ch=='0\n')break;
        i=0;
        num=0
        while(true){
            if(ch[i]=='\0')break;
            num+=ch[i]-'0';
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc:10:16: warning: multi-character character constant [-Wmultichar]
   10 |         if(ch=='0\n')break;
      |                ^~~~~
a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before 'while'
   12 |         num=0
      |              ^
      |              ;
   13 |         while(true){
      |         ~~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch='A';
    int num,i;
    while(true){
        scanf("%s",&ch);
        if(ch=='0\n')break;
        i=0;
        num=0;
        while(true){
            if(ch[i]=='\0')break;
            num+=ch[i]-'0';
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc:10:16: warning: multi-character character constant [-Wmultichar]
   10 |         if(ch=='0\n')break;
      |                ^~~~~
a.cc: In function 'int main()':
a.cc:14:18: error: invalid types 'char[int]' for array subscript
   14 |             if(ch[i]=='\0')break;
      |                  ^
a.cc:15:20: error: invalid types 'char[int]' for array subscript
   15 |             num+=ch[i]-'0';
      |                    ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){   //x=0のとき終わり
    char x[10];    //文字列を作成
    int sum = 0;
    
    while(1){
        scanf("%s",x);
        if(x == '0') break; //x=0のとき終わり
        
        for(int i = 0 ; x[i] != '\0'; i++){  //文字列に入力されたやつの末端まで読み込む 末端文字は\0と表す
            //printf("%d",x[i]," ");
            sum += x[i];
        }
        printf("%d",sum);
        printf("\n");
        //break;
    }
    
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(x == '0') break; //x=0のとき終わり
      |            ~~^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    char n;
    int sum=0;
    while(1){
        cin>>n;
        if (sum==0&&n=='0') break;
        else if (n=="\n"){
            cout<<sum<<endl;
            sum=0;
        }else{
            sum=sum+'n';
        }
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         else if (n=="\n"){
      |                  ~^~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<cctype>
#include<cstdio>
using namespace std;
int main(){
    string num;
    int sum = 0;
    while(1){
        cin >> num;
        if(num=="0"){
            break;
        }
        for(int i=0;i<(int)num.size();i++){
            sum = sum + (int)num[0] -48 
        }
        cout << endl;
        
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before '}' token
   15 |             sum = sum + (int)num[0] -48
      |                                        ^
      |                                        ;
   16 |         }
      |         ~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch='A';
    int num,i,a;
    while(true){
        scanf("%s",&ch);
        if(ch=='\n')break;
        i=0;
        num=0;
        while(true){
            if(ch[i]=='\0')break;
            a = ch[i]-'0';
            num += a;
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: invalid types 'char[int]' for array subscript
   14 |             if(ch[i]=='\0')break;
      |                  ^
a.cc:15:19: error: invalid types 'char[int]' for array subscript
   15 |             a = ch[i]-'0';
      |                   ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){   //x=0のとき終わり
    char x[10];    //文字列を作成
    
    
    while(1){
        int sum = 0;
        scanf("%s",x);
        if(x == '0') break; //x=0のとき終わり
        
        for(int i = 0 ; x[i] != '\0'; i++){  //文字列に入力されたやつの末端まで読み込む 末端文字は\0と表す
            //printf("%d",x[i]," ");
            sum += x[i];
        }
        printf("%d",sum);
        printf("\n");
        //break;
    }
    
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x == '0') break; //x=0のとき終わり
      |            ~~^~~~~~
Language: C++

#include<cstdio>

int main(){
    char t;
    while(1){
        scanf("%c",&t);
        if(t==0) break;
        
        int sum;
        if(t!="\n"){
            sum += t;
        } else {
            printf("%d\n",sum);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(t!="\n"){
      |            ~^~~~~~
Language: C++

#include<cstdio>

int main(){
    char t;
    while(1){
        scanf("%c",&t);
        if(t==0) break;
        
        int sum;
        if(t!="\n"){
            sum += int(t);
        } else {
            printf("%d\n",sum);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(t!="\n"){
      |            ~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a=0;
    char retu;
    while(1){
        scanf("%c",&retu);
        if(ch="0"){
            break;
        }
        for(int i=1;i<=retu.length;i++){
            int a;
            a=retu[i]-'0';
        }
        printf("%c",retu);
    }
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'ch' was not declared in this scope
    8 |         if(ch="0"){
      |            ^~
a.cc:11:29: error: request for member 'length' in 'retu', which is of non-class type 'char'
   11 |         for(int i=1;i<=retu.length;i++){
      |                             ^~~~~~
a.cc:13:19: error: invalid types 'char[int]' for array subscript
   13 |             a=retu[i]-'0';
      |                   ^
Language: C++

#include<cstdio>

int main(){
    char t;
    while(1){
        scanf("%c",&t);
        if(t==0) break;
        
        int sum;
        if(t!="\n"){
            int T = int(t)
            sum += T;
        } else {
            printf("%d\n",sum);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(t!="\n"){
      |            ~^~~~~~
a.cc:12:13: error: expected ',' or ';' before 'sum'
   12 |             sum += T;
      |             ^~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){   //x=0のとき終わり
    char x[10];    //文字列を作成
    
    
    while(1){
        int sum = 0;
        scanf("%s",x);
        if(x[0] == "0") break; //x=0のとき終わり
        
        for(int i = 0 ; x[i] != '\0'; i++){  //文字列に入力されたやつの末端まで読み込む 末端文字は\0と表す
            //printf("%d",x[i]," ");
            sum += x[i];
        }
        printf("%d",sum);
        printf("\n");
        //break;
    }
    
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x[0] == "0") break; //x=0のとき終わり
      |            ~~~~~^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    char n[1001];
    int sum=0;
    int a=0;
    while(1){
        cin>>n[a];
        if (n[0]==0) break;
        else if (n=='\n'){
            cout<<sum<<endl;
            sum=0;
            a=0;
        }else{
            sum=sum+'n';
            a+=1;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         else if (n=='\n'){
      |                  ~^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch[1000]='A';
    int num,i,a;
    while(true){
        scanf("%s",&ch);
        if(ch=='0')break;
        i=0;
        num=0;
        while(true){
            if(ch[i]=='\0')break;
            a = ch[i]-'0';
            num += a;
            i+=1;
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: array must be initialized with a brace-enclosed initializer
    6 |     char ch[1000]='A';
      |                   ^~~
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(ch=='0')break;
      |            ~~^~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch[1000]="A";
    int num,i,a;
    while(true){
        scanf("%s",&ch);
        if(ch=='0')break;
        i=0;
        num=0;
        while(true){
            if(ch[i]=='\0')break;
            a = ch[i]-'0';
            num += a;
            i+=1;
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(ch=='0')break;
      |            ~~^~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    char n[1001];
    int sum=0;
    int a=0;
    while(1){
        scanf("%c",&n[a])
        if (n[0]==0) break;
        else if (n[a]=='\n'){
            cout<<sum<<endl;
            sum=0;
            a=0;
        }else{
            sum=sum+'n';
            a+=1;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before 'if'
   10 |         scanf("%c",&n[a])
      |                          ^
      |                          ;
   11 |         if (n[0]==0) break;
      |         ~~                
a.cc:12:9: error: 'else' without a previous 'if'
   12 |         else if (n[a]=='\n'){
      |         ^~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch[1000]="A";
    int num,i,a;
    while(true){
        scanf("%s",&ch);
        if(ch=="0")break;
        i=0;
        num=0;
        while(i<1000){
            if(ch[i]=='\0')break;
            a = ch[i]-'0';
            num += a;
            a=;
            i+=1;
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected primary-expression before ';' token
   17 |             a=;
      |               ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    char ch[1000]="A";
    int num,i,a;
    while(true){
        scanf("%s",&ch);
        if(ch[0]=="0")break;
        i=0;
        num=0;
        while(true){
            if(ch[i]=='\0')break;
            a = ch[i]-'0';
            num += a;
            a=0;
            i+=1;
        }
        cout<<num<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(ch[0]=="0")break;
      |            ~~~~~^~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){   //x=0のとき終わり
    char x[10];    //文字列を作成
    
    
    while(1){
        int sum = 0;
        scanf("%s",x);
        if(x == '0') break; //x=0のとき終わり
        
        for(int i = 0 ; x[i] != '\0'; i++){  //文字列に入力されたやつの末端まで読み込む 末端文字は\0と表す
            //printf("%d",x[i]," ");
            int c = x[i] - '0';
            sum += c;
        }
        printf("%d",sum);
        printf("\n");
    }
    
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x == '0') break; //x=0のとき終わり
      |            ~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
#include<stdio.h>

int main(){
    
    int x,num;
    char fig = [5];
    
    while(1){
        scanf( "%d",x );
        if ( x == 0 ) break;
        for ( int i = 0; fig[i] != '\0'; i++){
            
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected identifier before numeric constant
    8 |     char fig = [5];
      |                 ^
a.cc: In lambda function:
a.cc:8:19: error: expected '{' before ';' token
    8 |     char fig = [5];
      |                   ^
a.cc: In function 'int main()':
a.cc:8:16: error: invalid user-defined conversion from 'main()::<lambda()>' to 'char' [-fpermissive]
    8 |     char fig = [5];
      |                ^~~
a.cc:8:16: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
    8 |     char fig = [5];
      |                ^
a.cc:8:16: note:   no known conversion from 'void (*)()' to 'char'
a.cc:13:29: error: invalid types 'char[int]' for array subscript
   13 |         for ( int i = 0; fig[i] != '\0'; i++){
      |                             ^
Language: C++

#include<iostream>
using namespace std;
#include<stdio.h>

int main(){
    
    int num = 0;
    char fig[5];
    
    while(1){
        scanf( "%d",fig );
        if ( fig == '0' ) break;
        for ( int i = 0; fig[i] != '\0'; i++){
            num += fig[i] - '0';
        }
        printf ( "%d\n", num );
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if ( fig == '0' ) break;
      |              ~~~~^~~~~~
Language: C++

#include<cstdio>
#include<cctype>
using namespace std;

int main(){
    int x;
    scanf("%s", x);
    char number[1000]=x;
    
    while(1){
        for(int i=0; i<=1000; i++)
            if(number[i]=="\n"&&number[i+1]==0) break;
            if(isdigit(number[i])) sum==number[i]+number[i+1];
    }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: array must be initialized with a brace-enclosed initializer
    8 |     char number[1000]=x;
      |                       ^
a.cc:12:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |             if(number[i]=="\n"&&number[i+1]==0) break;
      |                ~~~~~~~~~^~~~~~
a.cc:13:31: error: 'i' was not declared in this scope
   13 |             if(isdigit(number[i])) sum==number[i]+number[i+1];
      |                               ^
a.cc:13:36: error: 'sum' was not declared in this scope
   13 |             if(isdigit(number[i])) sum==number[i]+number[i+1];
      |                                    ^~~
a.cc:16:20: error: 'sum' was not declared in this scope
   16 |     printf("%d\n", sum);
      |                    ^~~
Language: C++

#include<cstdio>
#include<cctype>
using namespace std;

int main(){
    int x,sum;
    scanf("%s", x);
    char number[1001];
    
    while(1);
        if(number[0]==0) {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i]
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
a.cc:14:24: error: 'strlen' was not declared in this scope
   14 |         for(int i=0; i<strlen(number); i++){
      |                        ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cctype>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:15:29: error: expected ';' before '}' token
   15 |             sum += number[i]
      |                             ^
      |                             ;
   16 |         }
      |         ~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum;
    scanf("%s", x);
    char number[1001];
    
    while(1);
        if(number[0]==0) {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i]
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
a.cc:15:29: error: expected ';' before '}' token
   15 |             sum += number[i]
      |                             ^
      |                             ;
   16 |         }
      |         ~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum;
    scanf("%s", x);
    char number[1001];
    
    while(1);
        if(number[0]==0) {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum;
    scanf("%s", x);
    char number[1001];
    
    while(1);
        if(number[0]==0) break;
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: break statement not within loop or switch
   11 |         if(number[0]==0) break;
      |                          ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum;
    scanf("%s", x);
    char number[1001];
    
    while(1);
        if(number[0]=='0') {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum=0;
    scanf("%s", x);
    char number[1001];
    
    while(1);
        if(number[0]=='0') {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum=0;
    char number[1001];
    
    while(1);
    scanf("%s", num)
        if(number[0]=='0') {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'num' was not declared in this scope; did you mean 'sum'?
   10 |     scanf("%s", num)
      |                 ^~~
      |                 sum
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum=0;
    char number[1001];
    
    while(1);
    scanf("%s", num);
        if(number[0]=='0') {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'num' was not declared in this scope; did you mean 'sum'?
   10 |     scanf("%s", num);
      |                 ^~~
      |                 sum
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum=0;
    char number[1001];
    
    while(1);
    scanf("%s", number);
        if(number[0]=='0') {
            break;
        }
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: break statement not within loop or switch
   12 |             break;
      |             ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    int x,sum=0;
    char number[1001];
    
    while(1);
    scanf("%s", number);
        if(number[0]=='0') break;
        for(int i=0; i<strlen(number); i++){
            sum += number[i];
        }
    
    printf("%d\n", sum);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: break statement not within loop or switch
   11 |         if(number[0]=='0') break;
      |                            ^~~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    char number[1001];
    
    while(1){
        scanf("%s", number);
        if(number[0]=='0') break;
        for(int i=0; i<strlen(number); i++){
            int sum = 0;
            sum += (number[i]-'0');
        }
    
    printf("%d\n", sum);
    
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'sum' was not declared in this scope
   16 |     printf("%d\n", sum);
      |                    ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,a=0;
    while(1){
        cin>>x;
        if(x==0) break;
        char num[5]=x;
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a;
    }cout<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: array must be initialized with a brace-enclosed initializer
    8 |         char num[5]=x;
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,a=0;
    while(1){
        cin>>x;
        if(x==0) break;
        char num[5]='x';
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a;
    }cout<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: array must be initialized with a brace-enclosed initializer
    8 |         char num[5]='x';
      |                     ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,a=0;
    while(1){
        cin>>x;
        if(x==0) break;5
        char num[5];
        char num[5]='x';
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a;
    }cout<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before 'char'
    7 |         if(x==0) break;5
      |                         ^
      |                         ;
    8 |         char num[5];
      |         ~~~~             
a.cc:9:21: error: array must be initialized with a brace-enclosed initializer
    9 |         char num[5]='x';
      |                     ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,a=0;
    while(1){
        cin>>x;
        if(x==0) break;5
        char num[5]={};
        char num[5]='x';
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a;
    }cout<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before 'char'
    7 |         if(x==0) break;5
      |                         ^
      |                         ;
    8 |         char num[5]={};
      |         ~~~~             
a.cc:9:21: error: array must be initialized with a brace-enclosed initializer
    9 |         char num[5]='x';
      |                     ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,a=0;
    while(1){
        cin>>x;
        if(x==0) break;
        char num[5]={};
        char num[5]='x';
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a;
    }cout<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: redeclaration of 'char num [5]'
    9 |         char num[5]='x';
      |              ^~~
a.cc:8:14: note: 'char num [5]' previously declared here
    8 |         char num[5]={};
      |              ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int x,a=0;
    while(1){
        cin>>x;
        if(x==0) break;
        char num[5];
        char num[5]='x';
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a;
    }cout<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: redeclaration of 'char num [5]'
    9 |         char num[5]='x';
      |              ^~~
a.cc:8:14: note: 'char num [5]' previously declared here
    8 |         char num[5];
      |              ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    while(1){
        char num[5];
        scanf("%s",num);
        if(num[1]==0) break;
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a<<end;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'a' was not declared in this scope
    9 |             a+=num[i]-'0';
      |             ^
a.cc:11:15: error: 'a' was not declared in this scope
   11 |         cout<<a<<end;
      |               ^
Language: C++

#include<iostream>
#include<cstdio,h>
using namespace std;
int main(){
    int a;
    while(1){
        char num[5];
        scanf("%s",num);
        if(num[1]==0) break;
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a<<end;
    }
    
}


Compiler output:
a.cc:2:9: fatal error: cstdio,h: No such file or directory
    2 | #include<cstdio,h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<stdio,h>
using namespace std;
int main(){
    int a;
    while(1){
        char num[5];
        scanf("%s",num);
        if(num[1]==0) break;
        for(int i;i<5;i++){
            a+=num[i]-'0';
        }
        cout<<a<<end;
    }
    
}


Compiler output:
a.cc:2:9: fatal error: stdio,h: No such file or directory
    2 | #include<stdio,h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

int main(
    char num[1001];
    for(int i = 0; i < 1001; i++){
        char[i] = '0';
        int number = 0;
    }
    while(1){
        scanf("%c", num);
        for(int i = 0; i < 1001; i ++){
            int a = 'num[i]' - '0';
            number += a;
        }
        if(number == 0)break;
        cout << number << endl;
    }
}


Compiler output:
a.cc:13:21: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   13 |             int a = 'num[i]' - '0';
      |                     ^~~~~~~~
a.cc:5:19: error: expected ')' before ';' token
    5 |     char num[1001];
      |                   ^
      |                   )
a.cc:4:9: note: to match this '('
    4 | int main(
      |         ^
a.cc:4:5: warning: first argument of 'int main(char*)' should be 'int' [-Wmain]
    4 | int main(
      |     ^~~~
a.cc:4:5: warning: 'int main(char*)' takes only zero or two arguments [-Wmain]
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for(int i = 0; i < 1001; i++){
      |     ^~~
a.cc:6:20: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                    ^
a.cc:6:30: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                              ^
a.cc:10:5: error: expected unqualified-id before 'while'
   10 |     while(1){
      |     ^~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main()
    char num[1001];
    for(int i = 0; i < 1001; i++){
        char[i] = '0';
        int number = 0;
    }
    while(1){
        scanf("%c", num);
        for(int i = 0; i < 1001; i ++){
            int a = 'num[i]' - '0';
            number += a;
        }
        if(number == 0)break;
        cout << number << endl;
    }
}


Compiler output:
a.cc:13:21: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   13 |             int a = 'num[i]' - '0';
      |                     ^~~~~~~~
a.cc:5:5: error: expected initializer before 'char'
    5 |     char num[1001];
      |     ^~~~
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for(int i = 0; i < 1001; i++){
      |     ^~~
a.cc:6:20: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                    ^
a.cc:6:30: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                              ^
a.cc:10:5: error: expected unqualified-id before 'while'
   10 |     while(1){
      |     ^~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<cstdio>
using namespace std;

int main()
    char num[1001];
    for(int i = 0; i < 1001; i++){
        char[i] = '0';
        int number = 0;
    }
    while(1){
        scanf("%c", num);
        for(int i = 0; i < 1001; i ++){
            int a = 'num[i]' - '0';
            number += a;
        }
        if(number == 0)break;
        cout << number << endl;
    }
}


Compiler output:
a.cc:13:21: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   13 |             int a = 'num[i]' - '0';
      |                     ^~~~~~~~
a.cc:5:5: error: expected initializer before 'char'
    5 |     char num[1001];
      |     ^~~~
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for(int i = 0; i < 1001; i++){
      |     ^~~
a.cc:6:20: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                    ^
a.cc:6:30: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                              ^
a.cc:10:5: error: expected unqualified-id before 'while'
   10 |     while(1){
      |     ^~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<cstdio>
using namespace std;

int main()
    char num[1001];
    for(int i = 0; i < 1001; i++){
        char num[i] = '0';
        int number = 0;
    }
    while(1){
        scanf("%c", num);
        for(int i = 0; i < 1001; i ++){
            int a = 'num[i]' - '0';
            number += a;
        }
        if(number == 0)break;
        cout << number << endl;
    }
}


Compiler output:
a.cc:13:21: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   13 |             int a = 'num[i]' - '0';
      |                     ^~~~~~~~
a.cc:5:5: error: expected initializer before 'char'
    5 |     char num[1001];
      |     ^~~~
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for(int i = 0; i < 1001; i++){
      |     ^~~
a.cc:6:20: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                    ^
a.cc:6:30: error: 'i' does not name a type
    6 |     for(int i = 0; i < 1001; i++){
      |                              ^
a.cc:10:5: error: expected unqualified-id before 'while'
   10 |     while(1){
      |     ^~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<cstdio>
using namespace std;
int main(){
    char num[1001];
    for(int i = 0; i < 1001; i++){
        num[1001] ='0';
    }
    while(1){
        scanf("%s", num);
        if (num[0] == '0') break;
        int number = 0;
        for(int i = 0; i < 1001; i++){
            int a = num[i] = '0';
            number += 1;
        }
        cout << number << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << number << endl;
      |         ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:16:27: error: 'endl' was not declared in this scope
   16 |         cout << number << endl;
      |                           ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cstdio>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<cstdio>
// printf scanf //
#iclude<cstring>
// char型の文字列を操作できるもの //

int main(){
    char str[1001];
    
    while(1){
        scanf("%s",str);
        if (str[0] == '0') break;
        int sum = 0;
        for (int i=0, i<strlen(str), i++){
            sum += (str[i] - '0');
        }
        printf("%d\n",sum);
    }
    return 0;
}



Compiler output:
a.cc:3:2: error: invalid preprocessing directive #iclude; did you mean #include?
    3 | #iclude<cstring>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before '<' token
   13 |         for (int i=0, i<strlen(str), i++){
      |                        ^
      |                        ;
a.cc:13:24: error: expected primary-expression before '<' token
a.cc:13:25: error: 'strlen' was not declared in this scope
   13 |         for (int i=0, i<strlen(str), i++){
      |                         ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<cstdio>
  +++ |+#include <cstring>
    2 | // printf scanf //
a.cc:13:41: error: expected ';' before ')' token
   13 |         for (int i=0, i<strlen(str), i++){
      |                                         ^
      |                                         ;
Language: C++

#include<cstdio>
// printf scanf //
#iclude<cstring>
// char型の文字列を操作できるもの //

int main(){
    char str[1001];
    
    while(1){
        scanf("%s",str);
        if (str[0] == '0') break;
        int sum = 0;
        for (int i=0; i<strlen(str); i++){
            sum += (str[i] - '0');
        }
        printf("%d\n",sum);
    }
    return 0;
}



Compiler output:
a.cc:3:2: error: invalid preprocessing directive #iclude; did you mean #include?
    3 | #iclude<cstring>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:13:25: error: 'strlen' was not declared in this scope
   13 |         for (int i=0; i<strlen(str); i++){
      |                         ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<cstdio>
  +++ |+#include <cstring>
    2 | // printf scanf //
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char num[1001];
    int sum;
    while(1){
        scanf("%c",num);
        if(num == '0') break;
        sum = 0;
        for(int i == 0; num[i] != '\0'; i++){
            sum += num[i] - '0';
        }
        printf("%d",sum);
    }
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(num == '0') break;
      |            ~~~~^~~~~~
a.cc:11:18: error: expected ';' before '==' token
   11 |         for(int i == 0; num[i] != '\0'; i++){
      |                  ^~~
      |                  ;
a.cc:11:19: error: expected primary-expression before '==' token
   11 |         for(int i == 0; num[i] != '\0'; i++){
      |                   ^~
a.cc:11:39: error: expected ')' before ';' token
   11 |         for(int i == 0; num[i] != '\0'; i++){
      |            ~                          ^
      |                                       )
a.cc:11:41: error: 'i' was not declared in this scope
   11 |         for(int i == 0; num[i] != '\0'; i++){
      |                                         ^