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

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
char num_str[1002];
int num;
long sum=0;
int i;
char tmp;
while(){
fgets(num_str,sizeof(num_str),stdin);
if(num_str[0]=='0')
break;
for(i=0;i<strlen(num_str)-1;i++){
tmp=num_str[i];
num=atoi(&tmp);
sum+=num;
}
printf("%ld\n",sum);
sap=0;
mem set(num_str,1002,0);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: expected expression before ')' token
   10 | while(){
      |       ^
main.c:20:1: error: 'sap' undeclared (first use in this function)
   20 | sap=0;
      | ^~~
main.c:20:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:1: error: unknown type name 'mem'
   21 | mem set(num_str,1002,0);
      | ^~~
main.c:21:17: error: expected ')' before numeric constant
   21 | mem set(num_str,1002,0);
      |                 ^~~~
      |                 )
Language: C

#include <stdio.h>
int main (void)
{
	int sum[1000];
	int i;
	int j;
	int k=0;
	char array[1000];
	char n[10]={'0','1','2','3','4','5','6','7','8','9'};
		for(i=0;i<1000;i++){
	sum[i]=0;
	}
	while(1){
		for(i=0;i<1000;i++){
	array[i]='0';
	}
	scanf("%s",array);
		if(array[0]=='0'){
			break;
		}
	for(i=0;i<1000;i++){
		for(j=0;j<10;j++){
			if(n[j]==array[i]){
				sum[k]+=j;
			}
		}
	}
	k++;
	}
	
	for(i=0;i<=k;i++){
		if(sum[i]==0){
			break;
		}
	printf("%d\n",sum[i]);
	}
	return 0;

Compiler output:
main.c: In function 'main':
main.c:37:9: error: expected declaration or statement at end of input
   37 |         return 0;
      |         ^~~~~~
Language: C

#include <cstdio> 

char c; 

int answer; 

int main() {     

while (scanf("%c", &c) != EOF) {         

if (c == '\n') {             

if (answer == 0) break;             

printf("%d\n", answer);             

answer = 0;         } 

else {             

answer += c - '0';         

}     

}     

return 0; 

}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

int main (void){

char x[1001];

int i=0,sum=0;

while(i!=0){

while(i!=\0){

scanf("%s",x[i]);

while(i!=\0){

sum=sum+x[i];

i++;

}

printf("%s\n",x);

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:11:10: error: stray '\' in program
   11 | while(i!=\0){
      |          ^
main.c:15:10: error: stray '\' in program
   15 | while(i!=\0){
      |          ^
main.c:29:1: error: expected declaration or statement at end of input
   29 | }
      | ^
Language: C

#include<stdio.h>

int main (void){

char x[1001];

int i=0,sum=0;

while(i!=0){

scanf("%s",x[i]);

while(i!=\0){

sum=sum+x[i];

i++;

}

printf("%s\n",x);

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:13:10: error: stray '\' in program
   13 | while(i!=\0){
      |          ^
Language: C

#include<stdio.h>

int main(void)

{

char number [ 1001 ] = { 0 };

int i,sum=0;



while(1){

      sum=0;

       scanf("%s", &number );

       if( number[0]== ' 0 ' ) breake;

    

       for( i=0;number[ i ]!= ' \0 ' ;i++)

       {

                       sum=sum+( number[ i ] - ' 0 ' );

        }

        printf("%d\n",sum );

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:19:24: warning: multi-character character constant [-Wmultichar]
   19 |        if( number[0]== ' 0 ' ) breake;
      |                        ^~~~~
main.c:19:32: error: 'breake' undeclared (first use in this function)
   19 |        if( number[0]== ' 0 ' ) breake;
      |                                ^~~~~~
main.c:19:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:31: warning: multi-character character constant [-Wmultichar]
   23 |        for( i=0;number[ i ]!= ' \0 ' ;i++)
      |                               ^~~~~~
main.c:27:48: warning: multi-character character constant [-Wmultichar]
   27 |                        sum=sum+( number[ i ] - ' 0 ' );
      |                                                ^~~~~
Language: C

#include<stdio.h>

int main (void){

char x[1001];

int i=0,sum=0;

while(i!=0){

scanf("%s",x[i]);

}

while(i!=\0){

sum=sum+x[i];

i++;

}

printf("%s\n",x);

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:10: error: stray '\' in program
   15 | while(i!=\0){
      |          ^
Language: C

#include<stdio.h>

int main (void){

char x[1001];

int i=0,sum=0;

while(i!=0){

scanf("%s",x[i]);

}

while(x[i]!=\0){

sum=sum+x[i];

i++;

}

printf("%s\n",x);

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:13: error: stray '\' in program
   15 | while(x[i]!=\0){
      |             ^
Language: C

#include<stdio.h>

int main(void)
{

char number [ 1001 ] = { 0 };

int i , sum=0;



while( 1 ){

      sum=0;

       scanf("%s", &number );

       if( number[0]== ' 0 ' ) breake;

    

       for( i=0;number[ i ]!= ' \0 ' ;i++)

       {

                       sum=sum+( number[ i ] - ' 0 ' );

        }

        printf("%d\n",sum );

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:18:24: warning: multi-character character constant [-Wmultichar]
   18 |        if( number[0]== ' 0 ' ) breake;
      |                        ^~~~~
main.c:18:32: error: 'breake' undeclared (first use in this function)
   18 |        if( number[0]== ' 0 ' ) breake;
      |                                ^~~~~~
main.c:18:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:31: warning: multi-character character constant [-Wmultichar]
   22 |        for( i=0;number[ i ]!= ' \0 ' ;i++)
      |                               ^~~~~~
main.c:26:48: warning: multi-character character constant [-Wmultichar]
   26 |                        sum=sum+( number[ i ] - ' 0 ' );
      |                                                ^~~~~
Language: C

#include<stdio.h>

int main(void)
{

char number [ 1001 ] = { 0 };

int i , sum=0;



while( 1 ){

      sum=0;

       scanf("%s", &number );

       if( number[0]== ' 0 ' ) breake;

    

       for( i=0;number[ i ]!= ' \0 ' ;i++)

       {

                       sum=sum+( number[ i ] - ' 0 ' );

        }

        printf("%d\n", sum );

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:18:24: warning: multi-character character constant [-Wmultichar]
   18 |        if( number[0]== ' 0 ' ) breake;
      |                        ^~~~~
main.c:18:32: error: 'breake' undeclared (first use in this function)
   18 |        if( number[0]== ' 0 ' ) breake;
      |                                ^~~~~~
main.c:18:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:31: warning: multi-character character constant [-Wmultichar]
   22 |        for( i=0;number[ i ]!= ' \0 ' ;i++)
      |                               ^~~~~~
main.c:26:48: warning: multi-character character constant [-Wmultichar]
   26 |                        sum=sum+( number[ i ] - ' 0 ' );
      |                                                ^~~~~
Language: C

#include<stdio.h>

int main(void)
{

char number [ 1001 ] = { 0 };

int i , sum=0;



while(1){

      sum=0;

       scanf("%s", &number );

       if( number[0]== ' 0 ' ) breake;

    

       for( i=0;number[ i ]!= ' \0 ' ;i++)

       {

                       sum=sum+( number[ i ] - ' 0 ' );

        }

        printf("%d\n", sum );

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:18:24: warning: multi-character character constant [-Wmultichar]
   18 |        if( number[0]== ' 0 ' ) breake;
      |                        ^~~~~
main.c:18:32: error: 'breake' undeclared (first use in this function)
   18 |        if( number[0]== ' 0 ' ) breake;
      |                                ^~~~~~
main.c:18:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:31: warning: multi-character character constant [-Wmultichar]
   22 |        for( i=0;number[ i ]!= ' \0 ' ;i++)
      |                               ^~~~~~
main.c:26:48: warning: multi-character character constant [-Wmultichar]
   26 |                        sum=sum+( number[ i ] - ' 0 ' );
      |                                                ^~~~~
Language: C

#include<stdio.h>

int main (void){

char x[1001];

int i=0,sum=0;

while(i!=0){

scanf("%s",x);

}

while(x[i]!=\0){

sum=sum+x[i];

i++;

}

printf("%s\n",x);

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:13: error: stray '\' in program
   15 | while(x[i]!=\0){
      |             ^
Language: C

#include <stdio.h>
int main(void){
????
????????int sum , i;
????????char k[1000];
????????????
????????while(1){
????????????????scanf("%s",k);
????????????????if (k[0]=='0')break;
????????????????for (sum=0,i=0; k[i]!='\0'; i++) {
????????????????????????sum+=(k[i]-'0');
????????????????}
????????????????printf("%d\n",sum);
????????????????}
????
????????return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ????????char k[1000];
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????????????
      | ^
Language: C

#include<stdio.h>
int main(void)
{
??char num[1001];
??int i = 0;
??int sum = 1;?? 
????????while(sum!=0){
????????sum=0;
????????i=0;
??scanf("%c",&num[i]);?? 
while(num[i] != '\n'){
????i++;
????scanf("%c",&num[i]);
??}?? 
num[i] = '\0';?????? 
i = 0;
??while(num[i] != '\0'){
????sum += num[i] - '0';
????i++;
??}
??if(sum!=0){
??printf("%d\n",sum);
??}
??}
??return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
    4 | ??char num[1001];
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ??int i = 0;
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ??int sum = 1;??
      | ^
main.c:6:15: error: expected expression before '?' token
    6 | ??int sum = 1;??
      |               ^
Language: C

#include<stdio.h>
??
int main(void){
??
??
char number[1001]={0};
int i,sum=0;
??
??
??
while(1){
????????????sum=0;
????????????scanf("%s",&number);
????????????if(number[0]== '0' ) break;
??
??
????????????for(i=0;number[i]!= '\0';i++){
????????????????????????????sum=sum+(number[i]-'0');
????????????}
????????????printf("%d\n",sum);
??
}
return 0;
??
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
Language: C

#include<string.h>
int main(void){
int num,i,count,sum;
char number[1001];
char*str;
while(1){
scanf("%s",number);
i=0;
sum=0;
str=&number;
count=(int)strlen(str);
if(number[0]=='0'){
if(count==1){
break;}}
while(i<count){
num=number[i]-'0';
sum=sum+num;
i++;}
printf("%d\n",sum);}
return 0;]

Compiler output:
main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 | scanf("%s",number);
      | ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<string.h>
  +++ |+#include <stdio.h>
    2 | int main(void){
main.c:7:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 | scanf("%s",number);
      | ^~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:4: error: assignment to 'char *' from incompatible pointer type 'char (*)[1001]' [-Wincompatible-pointer-types]
   10 | str=&number;
      |    ^
main.c:19:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 | printf("%d\n",sum);}
      | ^~~~~~
main.c:19:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:10: error: expected statement before ']' token
   20 | return 0;]
      |          ^
main.c:20:10: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
int num,i,count,sum;
char number[1001];
char*str;
while(1){
scanf("%s",number);
i=0;
sum=0;
str=&number;
count=(int)strlen(str);
if(number[0]=='0'){
if(count==1){
break;}}
while(i<count){
num=number[i]-'0';
sum=sum+num;
i++;}
printf("%d\n",sum);}
return 0;]

Compiler output:
main.c: In function 'main':
main.c:11:4: error: assignment to 'char *' from incompatible pointer type 'char (*)[1001]' [-Wincompatible-pointer-types]
   11 | str=&number;
      |    ^
main.c:21:10: error: expected statement before ']' token
   21 | return 0;]
      |          ^
main.c:21:10: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>

int main(void){


car number[1001];


int i,sum;


while(1){


scanf("%s",number);


if(number[0]=='0')


break;


sum=0;


for(i=0;number[i]!='\0';i++{


sum+=number[i]-'0';


}


printf("%d\n",sum);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:6:1: error: unknown type name 'car'; did you mean 'char'?
    6 | car number[1001];
      | ^~~
      | char
main.c:27:28: error: expected ')' before '{' token
   27 | for(i=0;number[i]!='\0';i++{
      |    ~                       ^
      |                            )
main.c:39:1: error: expected expression before '}' token
   39 | }
      | ^
Language: C

#include<stdio.h>

int main(void){


car number[1001];


int i,sum;


while(1){


scanf("%s",number);


if(number[0]=='0')


break;


sum=0;


for(i=0;number[i]!='\0';i++)


sum+=number[i]-'0';


}


printf("%d\n",sum);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:6:1: error: unknown type name 'car'; did you mean 'char'?
    6 | car number[1001];
      | ^~~
      | char
main.c: At top level:
main.c:42:1: error: expected identifier or '(' before 'return'
   42 | return 0;
      | ^~~~~~
main.c:45:1: error: expected identifier or '(' before '}' token
   45 | }
      | ^
Language: C

#include<stdio.h>

int main(void){


char number[1001];


int i,sum;


while(1){


scanf("%s",number);


if(number[0]=='0')


break;


sum=0;


for(i=0;number[i]!='\0';i++)


sum+=number[i]-'0';


}


printf("%d\n",sum);


}


return 0;


}

Compiler output:
main.c:42:1: error: expected identifier or '(' before 'return'
   42 | return 0;
      | ^~~~~~
main.c:45:1: error: expected identifier or '(' before '}' token
   45 | }
      | ^
Language: C

#include<stdio.h>

#include<string.h>


int main(void)


{


 int sum;


 char str[1100];


 inti;


 for(i=0;i<1100;i++){


    str[i]=0;


  }


  while(1){


     scanf("%s",str);


     if(strcmp(str,"0")==0){


        break;


     }


     sum=0;


     for(i=0;str[i]!='\0';i++){


        sum+=str[i]-'0';


      }


      printf("%d\n",sum);


   }


   return 0;


}

Compiler output:
main.c: In function 'main':
main.c:18:2: error: 'inti' undeclared (first use in this function); did you mean 'int'?
   18 |  inti;
      |  ^~~~
      |  int
main.c:18:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:6: error: 'i' undeclared (first use in this function)
   21 |  for(i=0;i<1100;i++){
      |      ^
Language: C

#include<stdio.h>

#include<string.h>


int main(void)


{


 int sum;


 char str[1100];


 inti;


 for(i = 0;i < 1100;i++){


    str[i]=0;


  }


  while(1){


     scanf("%s",str);


     if(strcmp(str,"0") == 0){


        break;


     }


     sum=0;


     for(i = 0;str[i]! = '\0';i++){


        sum+=str[i]-'0';


      }


      printf("%d\n",sum);


   }


   return 0;


}

Compiler output:
main.c: In function 'main':
main.c:18:2: error: 'inti' undeclared (first use in this function); did you mean 'int'?
   18 |  inti;
      |  ^~~~
      |  int
main.c:18:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:6: error: 'i' undeclared (first use in this function)
   21 |  for(i = 0;i < 1100;i++){
      |      ^
main.c:48:22: error: expected ';' before '!' token
   48 |      for(i = 0;str[i]! = '\0';i++){
      |                      ^
      |                      ;
Language: C

#include <stdio.h>

#include

<stdlib.h>

int main(void){ 

int n,Count=0,count2=0,i,len,kazu[1000],sum=0; 

char x[1000],a; 

while(1){ 

sum=0; 

scanf("%s",x); 

if(x[0]=='0'){ 

break; 

} 

len=strlen(x); //????????°??°??? 

for(i=0;i<len;i++){ 

a=x[i]; 

kazu[i]=atoi(&a); 

sum=sum+kazu[i]; 

} 

printf("%d\n",sum);  

}   

return 0;

}

Compiler output:
main.c:3:9: error: #include expects "FILENAME" or <FILENAME>
    3 | #include
      |         ^
main.c:5:1: error: expected identifier or '(' before '<' token
    5 | <stdlib.h>
      | ^
Language: C

#include<stdio.h>

#include<string.h>

inr main(void)

{

   int sum;

   char str[1100];

   int i;

   for(i=0;i<1100;i++){

      str[i] = 0;

   }

   while(1){

      scanf("%s",str);

      if(strcmp(str,"0") == 0){

         break;

      }

      sum = 0;

      for(i=0;str[i]!='0';i++){

         sum += str[i] - '0';

      }

      printf("%d\n",sum);

   }

   return 0;

}

Compiler output:
main.c:5:1: error: unknown type name 'inr'; did you mean 'int'?
    5 | inr main(void)
      | ^~~
      | int
Language: C

#include<stdio.h>

#include<string.h>

inr main(void)

{

   int sum;

   char str[1100];

   int i;

   for(i=0;i<1100;i++){

      str[i] = 0;

   }

   while(1){

      scanf("%s",str);

      if(strcmp(str,"0")==0){

         break;

      }

      sum = 0;

      for(i=0;str[i]!='\0';i++){

         sum += str[i] - '0';

      }

      printf("%d\n",sum);

   }

   return 0;

}

Compiler output:
main.c:5:1: error: unknown type name 'inr'; did you mean 'int'?
    5 | inr main(void)
      | ^~~
      | int
Language: C

#include<stdio.h>

#include<string.h>

inr main(void)

{

   int sum;

   char str[1100];

   int i;

   for(i=0;i<1100;i++){

      str[i] = 0;

   }

   while(1){

      scanf("%s",str);

      if(strcmp(str,"0")==0){

         break;

      }

      sum = 0;

      for(i=0;str[i]!='\0';i++){

         sum += str[i]-'0';

      }

      printf("%d\n",sum);

   }

   return 0;

}

Compiler output:
main.c:5:1: error: unknown type name 'inr'; did you mean 'int'?
    5 | inr main(void)
      | ^~~
      | int
Language: C

#include<stdio.h>

#include<string.h>

inr main(void)

{

   int sum;

   char str[1100];

   int i;

   for(i=0;i<1100;i++){

      str[i]=0;

   }

   while(1){

      scanf("%s",str);

      if(strcmp(str,"0")==0){

         break;

      }

      sum=0;

      for(i=0;str[i]!='\0';i++){

         sum+=str[i]-'0';

      }

      printf("%d\n",sum);

   }

   return 0;

}

Compiler output:
main.c:5:1: error: unknown type name 'inr'; did you mean 'int'?
    5 | inr main(void)
      | ^~~
      | int
Language: C

#include<stdio.h>
#include<string.h>
inr main(void)
{
   int sum;
   char str[1100];
   int i;
   for(i=0;i<1100;i++){
      str[i]=0;
   }
   while(1){
      scanf("%s",str);
      if(strcmp(str,"0")==0){
         break;
      }
      sum=0;
      for(i=0;str[i]!='\0';i++){
         sum+=str[i]-'0';
      }
      printf("%d\n",sum);
   }
   return 0;

}

Compiler output:
main.c:3:1: error: unknown type name 'inr'; did you mean 'int'?
    3 | inr main(void)
      | ^~~
      | int
Language: C

#include<stdio.h>

#include<stdlib.h>

#include<string,h>

int main(void){

char num_str[1002];

int num;

long sum=0;

int i;

char tmp;

while(1){

fgets(num_str,sizeof(num_str),stdin);

if(num_str[0]=='0')break;

for(i=0;i<strlen(num_str)-1,i++){

tmp=num_str[i];

num=atoi(&tmp);

sum+=num;

}

printf("%ld\n",sum);

sum=0;

memset(num_str,1002,0);

}

return 0 ;

}

Compiler output:
main.c:5:9: fatal error: string,h: No such file or directory
    5 | #include<string,h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void){

char num_str[1002];

int num;

long sum=0;

int i;

char tmp;

while(1){

fgets(num_str,sizeof(num_str);stdin);

if(num_str[0]=='0')break;

for(i=0;i<strlen(num_str)-1,i++){

tmp=num_str[i];

num=atoi(&tmp);

sum+=num;

}

printf("%ld\n",sum);

sum=0;

memset(num_str,1002,0);

}

return 0 ;

}

Compiler output:
main.c: In function 'main':
main.c:21:30: error: expected ')' before ';' token
   21 | fgets(num_str,sizeof(num_str);stdin);
      |      ~                       ^
      |                              )
main.c:21:1: error: too few arguments to function 'fgets'
   21 | fgets(num_str,sizeof(num_str);stdin);
      | ^~~~~
In file included from main.c:1:
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
main.c:25:32: error: expected ';' before ')' token
   25 | for(i=0;i<strlen(num_str)-1,i++){
      |                                ^
      |                                ;
Language: C

#include<stdio.h>

#include<stdiib.h>

#include<string.h>

int main(void)

{

char num_str[1002];

int num;

long sum = 0;

int i;

char tmp;



while (1)

{

fgets(num_str, sizeof(num_str),stdin);

if (num_str[0] == '0') break;

for (i == 0; i < strlen(num_str)-1; i++)

{

tmp = num_str[i];

num = atoi(&tmp);

sum = sum+num;

}

printf("&ld\n",sum);

sum = 0;

memset(num_str,1002,0);

}

return 0;

}

Compiler output:
main.c:3:9: fatal error: stdiib.h: No such file or directory
    3 | #include<stdiib.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void){

char num_str[1002];

int num;

long sum=0;

int i;

int stdim=0+char tmp;

while(1)

{

fgets(num_str,sizeof(num_str),stdin);

if(num_str,[0]=='0')break;

for(i=0;i<strlen(num_str)-1;i++)

{

tmp=num_str[i];

num=atoi(&tmp);

sum=sum+num;

}

printf("%d\n",sum);

sum=0;

memset(num_str,1001,0);

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:17:13: error: expected expression before 'char'
   17 | int stdim=0+char tmp;
      |             ^~~~
main.c:25:12: error: expected expression before '[' token
   25 | if(num_str,[0]=='0')break;
      |            ^
main.c:31:1: error: 'tmp' undeclared (first use in this function)
   31 | tmp=num_str[i];
      | ^~~
main.c:31:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main (void){

while(1){

int i=0;

int sum=0;

char num[1001]={};

scanf("%s",num);

if(num[0]-'0'==0{break;}

while(num[i])

{

sum+=num[i]-'0';

i++;

}

printf("%d\n",sum);

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:17: error: expected ')' before '{' token
   15 | if(num[0]-'0'==0{break;}
      |   ~             ^
      |                 )
main.c:29:1: error: expected expression before '}' token
   29 | }
      | ^
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
  char[1000] = {0};
  int sum = 0;
  int i;

  while(1){
    scanf("%s", x);

    if(s[0] == '0')
      break;

    for(i = 0; i < 1000; i++)
      sum += atoi(x[i]);

    printf("%d", &sum);

    sum = 0;
  }

  return 0;

Compiler output:
main.c: In function 'main':
main.c:6:7: error: expected identifier or '(' before '[' token
    6 |   char[1000] = {0};
      |       ^
main.c:11:17: error: 'x' undeclared (first use in this function)
   11 |     scanf("%s", x);
      |                 ^
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:8: error: 's' undeclared (first use in this function)
   13 |     if(s[0] == '0')
      |        ^
main.c:24:3: error: expected declaration or statement at end of input
   24 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>

int main(void)
{
  char x[1000] = {0};
  int sum = 0;
  int i;

  while(1){
    scanf("%s", x);

    if(x[0] == '0')
      break;

    for(i = 0; i < 1000; i++){
      if(x[i] == '\0')
	break;
      
      switch(x[i]){
       case '0' : sum += 0;  break;
       case '1' : sum += 1;  break;
       case '2' : sum += 2;  break;
       case '3' : sum += 3;  break;
       case '4' : sum += 4;  break;
       case '5' : sum += 5;  break;
       case '6' : sum += 6;  break;
       case '7' : sum += 7;  break;
       case '8' : sum += 8;  break;
       case '9' : sum += 9;  break;
      }

    printf("%d\n", sum);

    sum = 0;
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:38:1: error: expected declaration or statement at end of input
   38 | }
      | ^
Language: C

#include<stdio.h>
??
int main(void)
??
??
{
??
??
char str[1010];
??
??
int i,sum;
??
??
scanf("%s",str);
??
??
while(str[0]!='0'){
??
??
i=0;
??
??
sum=0;
??
??
while(str[i]){
??
??
sum+=str[i]-'0';
??
??
i++;
??
??
}
??
??
printf("%d\n",sum);
??
??
scanf("%s",str);
??
??
}
??
??
return 0;
??
??
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
Language: C

#include<stdio.h>
??????
int main()
{
????????while (1)
????????{
????????????????char num[1001];
????????????????scanf("%s", num);
????????????????if (num[0] == '0') break;
????????????????int n, sum = 0;
????????????????for (n = 0; num[n] != '\0'; n++)
????????????????{
????????????????????????sum += num[n] - '0';
????????????????}
????????????????printf("%d\n", sum);
????????}
??????
????????return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??????
      | ^
Language: C

#include<stdio.h>
int main()
{
while (1)
{
char num[1001];
scanf("%s", num);
if (num[0] == '0') break;
int n, sum = 0;
for (n = 0; num[n] != '\0'; n++)
{
sum += num[n] - '0';
}
printf("%d\n", sum);
}??????
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:2: error: expected expression before '?' token
   15 | }??????
      |  ^
Language: C

#include<stdio.h>
int main(void)
{
while (1)
{
char num[1001];
scanf("%s",num);
if (num[0]=='0') break;
int n,sum=0;
for (n=0;num[n]!='\0';n++)
{
sum+=num[n]-'0';
}
printf("%d\n",sum);
}??????
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:2: error: expected expression before '?' token
   15 | }??????
      |  ^
Language: C

#include<stdio.h>
??
int main(void)
{
????????char x[1001];
????????int sum[10000];
????????int number;
????????int i, j;
????????int last = 0;
??????????
????????for(i = 0; last != 1; i++)
????????{
????????????????scanf("%s", x);
????????????????for(j = 0; x[j] != '\0'; j++)
????????????????{
????????????????????????if(j == 0)
????????????????????????{
????????????????????????????????sum[i] = (int)(x[j] - '0');
????????????????????????}
????????????????????????else
????????????????????????{
????????????????????????????????sum[i] += (int)(x[j] - '0');
????????????????????????}
??
????????????????}
????????????????if(x[0] == '0' && x[1] == '\0')
????????????????{
????????????????????????last = 1;
????????????????????????number = i;
????????????????}
????????}
??????????
????????for(i = 0; i < number; i++)
????????{
????????????????printf("%d\n", sum[i]);
????????}
????????return 0;
}
????????

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:39:1: error: expected identifier or '(' before '?' token
   39 | ????????
      | ^
Language: C

#include<stdio.h>
#include<string.h>

int main(){
  int i,sum;
  char a[1001];
  scanf("%s",a);
  while(strcmp(a,'0')){
    i=0:
    while(a[i]=='\0'){
      sum=sum+(a[i]-'0');
      i++;}
    printf("%d\n",sum);  
    scanf("%s",a);}
  return 0;}

Compiler output:
main.c: In function 'main':
main.c:8:18: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
    8 |   while(strcmp(a,'0')){
      |                  ^~~
      |                  |
      |                  int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:9:8: error: expected ';' before ':' token
    9 |     i=0:
      |        ^
      |        ;
Language: C

#include<stdio.h>
#include<string.h>

int main(){
  int i=0,sum,count=0;
  char a[1002];
  a[0]='a';
  while(1){
    count=0;
    i=0;
    while(!(a[i]=='\n')){
      i++;
      scanf("%c",a[i]);
      count++}
    sum=0;
    for(i=1;i<count;i++){
      sum=sum+(a[i]-'0');}
    if(sum==0) break;
    printf("%d\n",sum);}
  return 0;}
  

Compiler output:
main.c: In function 'main':
main.c:14:14: error: expected ';' before '}' token
   14 |       count++}
      |              ^
      |              ;
Language: C

#include <stdio.h>

int main()
{
    char[1000];
    int sum, i;

    while(1)
    {
        scanf("%s", k);
        if(k[0] == '0') break;
        sum = 0;
        for(i = 0; k[i] != '\n'; i++)
        {
            sum += (k[i] - '0');
        }
        printf("%d\n", sum);
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: expected identifier or '(' before '[' token
    5 |     char[1000];
      |         ^
main.c:10:21: error: 'k' undeclared (first use in this function)
   10 |         scanf("%s", k);
      |                     ^
main.c:10:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>   

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

Compiler output:
main.c: In function 'main':
main.c:7:17: error: empty character constant
    7 |  char str[100]={''};
      |                 ^~
main.c:15:13: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   15 |   a=atoi(str[i]);
      |          ~~~^~~
      |             |
      |             char
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'char'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>   

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

Compiler output:
main.c: In function 'main':
main.c:9:20: error: 'k' undeclared (first use in this function)
    9 |         scanf("%s",k);
      |                    ^
main.c:9:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>   

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

Compiler output:
main.c: In function 'main':
main.c:9:20: error: 'sr' undeclared (first use in this function); did you mean 'str'?
    9 |         scanf("%s",sr);
      |                    ^~
      |                    str
main.c:9:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
 
int main(void){

	std::string x;
	int p=0;
	int num=0;

	while(true){
	std::cin >> x;
		if(x=="0")break;
		for(int i = 0; i < (int)x.size(); ++i){
			int ch = x[i]-'0';
			p=p+ch;
		}
		std::cout << p << std::endl;
		p=0;
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'std' undeclared (first use in this function); did you mean 'stdin'?
    5 |         std::string x;
      |         ^~~
      |         stdin
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:12: error: expected ';' before '::' token
    5 |         std::string x;
      |            ^~
      |            ;
main.c:9:15: error: 'true' undeclared (first use in this function)
    9 |         while(true){
      |               ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:10:12: error: expected ';' before '::' token
   10 |         std::cin >> x;
      |            ^~
      |            ;
main.c:11:20: error: 'x' undeclared (first use in this function)
   11 |                 if(x=="0")break;
      |                    ^
main.c:16:20: error: expected ';' before '::' token
   16 |                 std::cout << p << std::endl;
      |                    ^~
      |                    ;
Language: C

#include <stdio.h>

int main(void){

	char num[1001];
	int sum;
	int i,j;

	while(scanf("%s", num)){
		sum=0;
		if (num[0]=='0'){
			break;
	}

	j=strlen(num);
		for(i=0; i<j; i++){
			num[i]-='0';
			sum += num[i];
		
		printf("%d\n",sum);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   15 |         j=strlen(num);
      |           ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:15:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   15 |         j=strlen(num);
      |           ^~~~~~
main.c:15:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
int sum,num;
char NUM;
while(1){
scanf("%c",&NUM);
if (NUM == 0){
break;
}
while(1){
if (NUM == '\n'){
break;
}else{
num=atoi(NUM);
sum += num;
scanf("%c",&NUM);
}
}
printf("%d\n",num);
}
return0;
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   14 | num=atoi(NUM);
      |     ^~~~
main.c:21:1: error: 'return0' undeclared (first use in this function)
   21 | return0;
      | ^~~~~~~
main.c:21:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int x;
	int sum=0;
	
	while(1){
		scanf("%d",&x);
		if(x==0)break;
		
		for(i=1000;i=1;i/=10){
			sum+=x/i;
			x=x%i;
		}
		printf("%d\n",sum);
		sum=0;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:21: error: 'i' undeclared (first use in this function)
   10 |                 for(i=1000;i=1;i/=10){
      |                     ^
main.c:10:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>   //???????????£???ver ??§????????°????????¨atoi????????????ASCII????????§??????????????£??????
#include<stdlib.h>
int main(){
    int sum = 0, suuti = 0, i, n;
    char num[1001] = {};
    for( i = 0;; i++){
        scanf("%c",&num[i]);
        if( num[0] == '0' ){
            break;
        }
        suuti = 1201toi( &num[i] );

        sum += suuti;

        if( num[i] == '\n' ){
            printf("%d\n", sum);
            sum = 0;
            for( n = 0; n <= i; n++ ){
                num[n] = 0;
            }
            i = -1;
        }

    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: invalid suffix "toi" on integer constant
   11 |         suuti = 1201toi( &num[i] );
      |                 ^~~~~~~
Language: C

#include<stdio.h>
int main(){
 long double N[1000];
 int T[1000]={0};
 int i,j;

/*????????????????????????*/
 for(i=0;i<1000;i++){
  scanf("%ld\n",&N[i]);
  
  if(N[i]==0){
   j=i;
   break;
  }
 }

/*???????¨??????¨??¨???*/
 for(i=0;i<j;i++){
   while(N[i]!=0){
    T[i]+=N[i]%10;
    N[i]/=10;
   }

   printf("%d\n",T[i]);

 }


return 0;
}

  

Compiler output:
main.c: In function 'main':
main.c:20:15: error: invalid operands to binary % (have 'long double' and 'int')
   20 |     T[i]+=N[i]%10;
      |           ~~~~^
      |            |
      |            long double
Language: C

#include<stdio.h>
int main(){
 long double N[1000];
 int T[1000]={0};
 int i,j;

/*????????????????????????*/
 for(i=0;i<1000;i++){
  scanf("%Le\n",&N[i]);
  
  if(N[i]==0){
   j=i;
   break;
  }
 }

/*???????¨??????¨??¨???*/
 for(i=0;i<j;i++){
   while(N[i]!=0){
    T[i]+=N[i]%10;
    N[i]/=10;
   }

   printf("%d\n",T[i]);

 }


return 0;
}

  

Compiler output:
main.c: In function 'main':
main.c:20:15: error: invalid operands to binary % (have 'long double' and 'int')
   20 |     T[i]+=N[i]%10;
      |           ~~~~^
      |            |
      |            long double
Language: C

int main() {
int a,total;
while(a==0) {
scanf("%d"&a);
total += a/100;
total += a%100-a%10;
total += a%10;
printf("%d",total);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf("%d"&a);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf("%d"&a);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:11: error: invalid operands to binary & (have 'char *' and 'int')
    4 | scanf("%d"&a);
      |       ~~~~^
      |       |
      |       char *
main.c:8:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 | printf("%d",total);
      | ^~~~~~
main.c:8:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main() {
int a,total;
while(a==0) {
scanf("%d"&a);
total += a/1000
total += a/100;
total += a%100-a%10;
total += a%10;
printf("%d\n",total);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf("%d"&a);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf("%d"&a);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:11: error: invalid operands to binary & (have 'char *' and 'int')
    4 | scanf("%d"&a);
      |       ~~~~^
      |       |
      |       char *
main.c:5:16: error: expected ';' before 'total'
    5 | total += a/1000
      |                ^
      |                ;
    6 | total += a/100;
      | ~~~~~           
main.c:9:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    9 | printf("%d\n",total);
      | ^~~~~~
main.c:9:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int main()
{
  int i, d[128], ans;
  char data[128];
  while(1) {
    ans = 0;
    gets(data);
    for(i = 0; data[i] != '\0'; ++i) {
      d[i] = (int)(data[i] - '0');
    }
    if(d[0] == 0 && d[1] == '\0')
      break;
    else
      for(i = 0; d[i] != '\0'; ++i) {
        ans += d[i];
      }
    printf("%d\n", ans);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    9 |     gets(data);
      |     ^~~~
      |     fgets
Language: C

#include <stdio.h>

int main(void)
{
	char number[1000];
	int count = 0;
	int i = 0;
	int sum = 0;
	
	gets(number);
	
	if(number[i] == '0')
	{
		goto shineora;
	}
	
	while(number[i] != '\0')
	{
		count++;
		i++;
	}
	
	for(i=0;i<count;i++)
	{
		sum += ((int)number[i] - '0');
	}
	
	printf("%d\n",sum);
	
	shineora:
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(number);
      |         ^~~~
      |         fgets
Language: C

#include <stdio.h>

int main(void)
{
	char number[1000];
	int count = 0;
	int i = 0;
	int sum = 0;
	
	fgets(number);
	
	if(number[i] == '0')
	{
		goto shineora;
	}
	
	while(number[i] != '\0')
	{
		count++;
		i++;
	}
	
	for(i=0;i<count;i++)
	{
		sum += ((int)number[i] - '0');
	}
	
	printf("%d\n",sum);
	
	shineora:
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: too few arguments to function 'fgets'
   10 |         fgets(number);
      |         ^~~~~
In file included from main.c:1:
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
Language: C

#include <stdio,h>

int main(void){
    char s[1000];
    int i;
    int sum = 0;

    while(1){
        scanf("%s", s);
        if(s == "0")
            break;

        while(s){
            sum += s[i] - '0';
            i++;
        }
        printf("%d\n", sum);
        sum = 0;
        i = 0;
    }
    return 0;
}


Compiler output:
main.c:1:10: fatal error: stdio,h: No such file or directory
    1 | #include <stdio,h>
      |          ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(void){
    char s[1000];
    int i = 0;
    int sum = 0;

    while(1){
        scanf("%s", s);
        if([0] - '0' == 0)
            break;

        while(s[i]){
            sum += s[i] - '0';
            i++;
        }
        printf("%d\n", sum);
        sum = 0;
        i = 0;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:12: error: expected expression before '[' token
   10 |         if([0] - '0' == 0)
      |            ^
Language: C

#include <stdio.h>

int main(void)
{
	int num[256], i, t;
	unsigned char x[1001];

	num['0'] = 0;
	num['1'] = 1;
	num['2'] = 2;
	num['3'] = 3;
	num['4'] = 4;
	num['5'] = 5;
	num['6'] = 6;
	num['7'] = 7;
	num['8'] = 8;
	num['9'] = 9;

	for (;;) {
		t = 0;
		scanf("%s", x);
		for (i = 0; s[i] != '\0'; i++) {
			t += num[x[i]];
		}
		if (t == 0) return 0;
		printf("%d\n", t);
	}
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:22:29: error: 's' undeclared (first use in this function)
   22 |                 for (i = 0; s[i] != '\0'; i++) {
      |                             ^
main.c:22:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	unsigned double num;
	unsigned short ans = 0;
	int i;
	
	while(1){
		scanf("%lf", &num);
		
		if(num == 0){
			break;
		}
		
		do{
			ans += num % 10;
			num /= 10;
		}while(num > 0);
		
		printf("%d\n", ans);
		
		ans = 0;
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:3:18: error: both 'unsigned' and 'double' in declaration specifiers
    3 |         unsigned double num;
      |                  ^~~~~~
Language: C

#include <stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:11:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   11 |         x=strlen(number);
      |           ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:11:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   11 |         x=strlen(number);
      |           ^~~~~~
main.c:11:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:21:5: error: expected declaration or statement at end of input
   21 |     return 0;
      |     ^~~~~~
Language: C

#include<stdio.h>
 
int main()
{
    char x;
    int sum=0,i=0;
 while(1){
        scanf("%c",x);
        if(x[0]=='0'&&x[1]=='\0')
            break;
       
        while(x[i] != '\0')
            sum += x[i++] - '0';
        printf("%d\n",sum);
    }
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:13: error: subscripted value is neither array nor pointer nor vector
    9 |         if(x[0]=='0'&&x[1]=='\0')
      |             ^
main.c:9:24: error: subscripted value is neither array nor pointer nor vector
    9 |         if(x[0]=='0'&&x[1]=='\0')
      |                        ^
main.c:12:16: error: subscripted value is neither array nor pointer nor vector
   12 |         while(x[i] != '\0')
      |                ^
main.c:13:21: error: subscripted value is neither array nor pointer nor vector
   13 |             sum += x[i++] - '0';
      |                     ^
Language: C

#include <stdio.h>
int main(void){
 int num,a;
int count=0;
while(1){
int sum = 0;
scanf("%d", &num);
if(num==0)break;

while(num>0){
  a = num % 10;
  sum = sum + a;
  num = num / 10;
  count++;
}
if(count<1000)
printf("%d\n", sum)；
  }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:20: error: expected ';' before '\U0000ff1b'
   17 | printf("%d\n", sum)；
      |                    ^~
      |                    ;
Language: C

＃include <stdio.h>

int main(void)

{ int num,a;

while(1){

int sum = 0;

scanf("%d", &num);

if(num==0)break;

int count=0;

while(num>0){

  a = num % 10;

  sum = sum + a;

  num = num / 10;

  count++;

}

if(count<1000)

printf("%d\n", sum);



  }

return 0;

}


Compiler output:
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | ＃include <stdio.h>
      |           ^
Language: C

#include <stdio.h>

int main()
{
        double x;
        while(1) {
                scanf("%ld", &x);

                if (x == 0) break;

                int result = 0;
                while (x != 0) {
                                result += x % 10;
                                x /= 10;
                }
                printf("%d\n", result);
        }
}


Compiler output:
main.c: In function 'main':
main.c:13:45: error: invalid operands to binary % (have 'double' and 'int')
   13 |                                 result += x % 10;
      |                                             ^
Language: C

#include <stdio.h>

int main()
{
        double x;
        while(1) {
                scanf("%lf", &x);

                if (x == 0) break;

                int result = 0;
                while (x != 0) {
                                result += x % 10;
                                x /= 10;
                }
                printf("%d\n", result);
        }
}


Compiler output:
main.c: In function 'main':
main.c:13:45: error: invalid operands to binary % (have 'double' and 'int')
   13 |                                 result += x % 10;
      |                                             ^
Language: C

include <stdio.h>
int main(void){ 
 char num[1010];
  int a;
  while(1){
      scanf("%s", &num);
      if(num[0]=='0')
      break; 
     else{
        //   printf("%lld\n", num); 
     int sum = 0;
      for(int i=0;
 i<strlen(num);
 i++){
          sum+=num[i]-'0';
//i桁目の文字を数字に変換 
     } 
     printf("%d\n", sum);
      }  }  
return 0; 
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^