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


#include<iostream>
#inclede<cstdio>
using namespace std;
  
int main()
{
    int b,sum;
	char number[1001];//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> number;
			if(number =='\n'){
				break;
			}
			b = number -'0';//????????? number ????????? i ?????°????????????
			sum = sum + b;
		}
 		if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<cstdio>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:15:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                         if(number =='\n'){
      |                            ~~~~~~~^~~~~~
a.cc:18:36: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |                         b = number -'0';//????????? number ????????? i ?????°????????????
      |                             ~~~~~~~^~~~
      |                                    |
      |                                    char*
Language: C++


#include<iostream>
#inclede<cstdio>
using namespace std;
  
int main()
{
    int b,sum;
	char number[1001];//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> number;
			if(number ='0){
				break;
			}
			b = number -'0';//????????? number ????????? i ?????°????????????
			sum = sum + b;
		}
 		if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<cstdio>
      |  ^~~~~~~
      |  include
a.cc:15:36: warning: missing terminating ' character
   15 |                         if(number ='0){
      |                                    ^
a.cc:15:36: error: missing terminating ' character
   15 |                         if(number ='0){
      |                                    ^~~~
a.cc: In function 'int main()':
a.cc:16:33: error: expected primary-expression before 'break'
   16 |                                 break;
      |                                 ^~~~~
a.cc:17:25: error: expected primary-expression before '}' token
   17 |                         }
      |                         ^
a.cc:16:39: error: expected ')' before '}' token
   16 |                                 break;
      |                                       ^
      |                                       )
   17 |                         }
      |                         ~              
a.cc:15:27: note: to match this '('
   15 |                         if(number ='0){
      |                           ^
a.cc:17:25: error: expected primary-expression before '}' token
   17 |                         }
      |                         ^
a.cc:18:36: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |                         b = number -'0';//????????? number ????????? i ?????°????????????
      |                             ~~~~~~~^~~~
      |                                    |
      |                                    char*
a.cc:22:25: error: break statement not within loop or switch
   22 |                         break;
      |                         ^~~~~
a.cc: At global scope:
a.cc:26:9: error: expected unqualified-id before 'return'
   26 |         return 0;
      |         ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++


#include<iostream>
#inclede<stdio.h>
using namespace std;
  
int main()
{
    int b,c;
	char number[1001];//?????????
	
	while(1){
		c = 0;
		while(1){
			cin >> number;
			if(number == 0){
				break;
			}
			b = number -'0';//????????? number ????????? i ?????°????????????
			c = c + b;
		}
 		if(c == 0){
 			break;
 		}
		cout << c << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<stdio.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:18:36: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |                         b = number -'0';//????????? number ????????? i ?????°????????????
      |                             ~~~~~~~^~~~
      |                                    |
      |                                    char*
Language: C++


#include<iostream>
#inclede<cstdio>
using namespace std;
  
int main()
{
    int b,c;
	char number[1001];//?????????
	
	while(1){
		c = 0;
		while(1){
			cin >> number;
			if(number == "\n"){
				break;
			}
			b = number -'0';//????????? number ????????? i ?????°????????????
			c = c + b;
		}
 		if(c == 0){
 			break;
 		}
		cout << c << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<cstdio>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:18:36: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |                         b = number -'0';//????????? number ????????? i ?????°????????????
      |                             ~~~~~~~^~~~
      |                                    |
      |                                    char*
Language: C++


#include<iostream>
#inclede<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char number[1001];//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> number;
			if(number[0] == 0){
				break;
			}
			b = number-'0';//????????? number ????????? i ?????°????????????
			c = c + b;
		}
 		if(c == 0){
 			break;
 		}
		cout << c << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<stdio.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:18:35: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |                         b = number-'0';//????????? number ????????? i ?????°????????????
      |                             ~~~~~~^~~~
      |                                   |
      |                                   char*
a.cc:19:25: error: 'c' was not declared in this scope
   19 |                         c = c + b;
      |                         ^
a.cc:21:20: error: 'c' was not declared in this scope
   21 |                 if(c == 0){
      |                    ^
a.cc:24:25: error: 'c' was not declared in this scope
   24 |                 cout << c << endl;
      |                         ^
Language: C++


#include<iostream>
#inclede<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char number[1001];//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> number;
			if(number[0] == 0){
				break;
			}
			b = number-'0';//????????? number ????????? i ?????°????????????
			sum = sum + b;
		}
 		if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

	

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<stdio.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:18:35: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |                         b = number-'0';//????????? number ????????? i ?????°????????????
      |                             ~~~~~~^~~~
      |                                   |
      |                                   char*
Language: C++


#include<iostream>
#inclede<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char number[1001];//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> number;
			if(number[0] == 0){
				break;
			}
			b = *number-'0';//????????? number ????????? i ?????°????????????
			sum = sum + b;
		}
 		if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<stdio.h>
      |  ^~~~~~~
      |  include
Language: C++


#include<iostream>
#inclede<cstdio>
using namespace std;
  
int main()
{
    int b,sum;
	char number[1001];//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> number;
			if(number[0] == 0){
				break;
			}
			b = *number-'0';//????????? number ????????? i ?????°????????????
			sum = sum + b;
		}
 		if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

	
	

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclede; did you mean #include?
    3 | #inclede<cstdio>
      |  ^~~~~~~
      |  include
Language: C++


#include<iostream>
#include<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char x;//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> x;
			if(x == 0){
				break;
			}
			b = *x-'0';//????????? number ????????? i ?????°????????????
			sum = sum + b;
		}
 		if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: invalid type argument of unary '*' (have 'char')
   18 |                         b = *x-'0';//????????? number ????????? i ?????°????????????
      |                             ^~
Language: C++

//???????????????????????????Aizu??§???runnning
#include<iostream>
#include<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char x;//?????????
	
	while(1){
		sum = 0;
		while(1){
			cin >> x;
			//x=0?????¨?????????
			if(x == 0){
				break;
			}
			b = x-'0';//?????????x?????????i?????°????????????
			sum = sum + b;
		}
 		//if(sum == 0){
 			break;
 		}
		cout << sum << endl;
	}
	return 0;
}

	

Compiler output:
a.cc:27:9: error: expected unqualified-id before 'return'
   27 |         return 0;
      |         ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

//???????????????????????????Aizu??§???runnning
#include<iostream>
#include<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char x[1001];//?????????
	
	while(1){
		int sum = 0;
		cin >> x;
		//x=0?????¨?????????
		if(x == 0){
			break;
		}
		for( i=0; i<strlen(str); i++){
		b = x[i]-'0';//?????????x?????????i?????°????????????
		sum = sum + b;
	}
 		
 		}
		cout << sum << endl;
	}
	return 0;
}

	

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: 'i' was not declared in this scope
   18 |                 for( i=0; i<strlen(str); i++){
      |                      ^
a.cc:18:36: error: 'str' was not declared in this scope; did you mean 'std'?
   18 |                 for( i=0; i<strlen(str); i++){
      |                                    ^~~
      |                                    std
a.cc:18:29: error: 'strlen' was not declared in this scope
   18 |                 for( i=0; i<strlen(str); i++){
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<iostream>
  +++ |+#include <cstring>
    3 | #include<stdio.h>
a.cc: At global scope:
a.cc:26:9: error: expected unqualified-id before 'return'
   26 |         return 0;
      |         ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

//???????????????????????????Aizu??§???runnning
#include<iostream>
#include<stdio.h>
using namespace std;
  
int main()
{
    int b,sum;
	char x[1001];//?????????
	
	while(1){
		int sum = 0;
		cin >> x;
		//x=0?????¨?????????
		if(x == 0){
			break;
		}
		for( i=0; i<strlen(str); i++){
		b = x[i]-'0';//?????????x?????????i?????°????????????
		sum +=  b;
	}
 		
 		}
		cout << sum << endl;
	}
	return 0;
}

	

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: 'i' was not declared in this scope
   18 |                 for( i=0; i<strlen(str); i++){
      |                      ^
a.cc:18:36: error: 'str' was not declared in this scope; did you mean 'std'?
   18 |                 for( i=0; i<strlen(str); i++){
      |                                    ^~~
      |                                    std
a.cc:18:29: error: 'strlen' was not declared in this scope
   18 |                 for( i=0; i<strlen(str); i++){
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<iostream>
  +++ |+#include <cstring>
    3 | #include<stdio.h>
a.cc: At global scope:
a.cc:26:9: error: expected unqualified-id before 'return'
   26 |         return 0;
      |         ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

//???????????????????????????Aizu??§???runnning
#include<iostream>
#include<stdio.h>
using namespace std;
  
int main()
{
    int b,sum,i;
	char x[1001];//?????????
	
	while(1){
		int sum = 0;
		cin >> x;
		//x=0?????¨?????????
		if(x == 0){
			break;
		}
		for( i=0; i<strlen(str); i++){
		b = x[i]-'0';//?????????x?????????i?????°????????????
		sum +=  b;
	}
 		
 		}
		cout << sum << endl;
	}
	return 0;
}

	

Compiler output:
a.cc: In function 'int main()':
a.cc:18:36: error: 'str' was not declared in this scope; did you mean 'std'?
   18 |                 for( i=0; i<strlen(str); i++){
      |                                    ^~~
      |                                    std
a.cc:18:29: error: 'strlen' was not declared in this scope
   18 |                 for( i=0; i<strlen(str); i++){
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<iostream>
  +++ |+#include <cstring>
    3 | #include<stdio.h>
a.cc: At global scope:
a.cc:26:9: error: expected unqualified-id before 'return'
   26 |         return 0;
      |         ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

//???????????????????????????Aizu??§???runnning
#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
  
int main()
{
    int b,sum,i;
	char x[1001];//?????????
	
	while(1){
		int sum = 0;
		cin >> x;
		//x=0?????¨?????????
		if(x == 0){
			break;
		}
		for( i=0; i<x.size(); i++){
		b = x[i]-'0';//?????????x?????????i?????°????????????
		sum += b;
		}
		cout << sum << endl;
	}
	return 0;
}

	

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

#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
  int a;
  while (cin >> a, a){
    int sum = 0;
    for (a > 0){
      sum += (a % 10);
      a /= 10;
    }
    cout << sum << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected ';' before ')' token
   11 |     for (a > 0){
      |               ^
      |               ;
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
a.cc:15:25: error: expected ')' before '}' token
   15 |     cout << sum << endl;
      |                         ^
      |                         )
   16 |   }
      |   ~                      
a.cc:11:9: note: to match this '('
   11 |     for (a > 0){
      |         ^
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
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 tep;


while (1)


{


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


ifb(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:
a.cc: In function 'int main()':
a.cc:38:1: error: 'ifb' was not declared in this scope
   38 | ifb(num_str[0] == '0')break;
      | ^~~
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
a.cc:47:1: error: 'tmp' was not declared in this scope; did you mean 'tep'?
   47 | tmp = num_str[i];
      | ^~~
      | tep
a.cc: At global scope:
a.cc:59:7: error: expected constructor, destructor, or type conversion before '(' token
   59 | printf("%ld\n",sum);
      |       ^
a.cc:62:1: error: 'sum' does not name a type
   62 | sum = 0;
      | ^~~
a.cc:65:7: error: expected constructor, destructor, or type conversion before '(' token
   65 | memset(num_str, 1002,0);
      |       ^
a.cc:68:1: error: expected declaration before '}' token
   68 | }
      | ^
a.cc:71:1: error: expected unqualified-id before 'return'
   71 | return 0:
      | ^~~~~~
a.cc:74:1: error: expected declaration before '}' token
   74 | }
      | ^
Language: C++

#include<stdio.h>

#include<string.h>


#include<stdlib.h>





int main(void)


{


int i,sum,slen;


char number[1001],num[2];


while(1){


sum=0;


f get s(number,sizeof(number),stdin);





slen=strlen(number);





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


num[0]=number[i];


sum+=atoi(num);


}


if(sum==0){


break;


}


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


}


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:1: error: 'f' was not declared in this scope
   30 | f get s(number,sizeof(number),stdin);
      | ^
Language: C++

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

int n,i,ai,min,max,;
long sum;

sum=0;
min=1000000;
max=-1000000;
scanf("%d",%n);
for(i=1;i<n;i++){
scanf("%d",&ai);
sum+=ao;
if(max=ai;
}
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:20: error: expected unqualified-id before ';' token
    4 | int n,i,ai,min,max,;
      |                    ^
a.cc:10:12: error: expected primary-expression before '%' token
   10 | scanf("%d",%n);
      |            ^
a.cc:13:6: error: 'ao' was not declared in this scope; did you mean 'ai'?
   13 | sum+=ao;
      |      ^~
      |      ai
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
a.cc:14:11: error: expected ')' before '}' token
   14 | if(max=ai;
      |   ~       ^
      |           )
   15 | }
      | ~          
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
a.cc: At global scope:
a.cc:17:7: error: expected constructor, destructor, or type conversion before '(' token
   17 | printf("%d %d %lld\n",min,max,sum);
      |       ^
a.cc:18:1: error: expected unqualified-id before 'return'
   18 | return 0;
      | ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

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

int n,i,ai,min,max,;
long sum;

sum=0;
min=1000000;
max=-1000000;
scanf("%d",%n);
for(i=1;i<n;i++){
scanf("%d",&ai);
sum+=ai;
if(min>ai){
min=ai;
}
if(max<ai){
max=ai;
}
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:20: error: expected unqualified-id before ';' token
    4 | int n,i,ai,min,max,;
      |                    ^
a.cc:10:12: error: expected primary-expression before '%' token
   10 | scanf("%d",%n);
      |            ^
Language: C++

int main()
{
	long i,n,ai;	//long??£?????????????????????int?????¨??°???10000000?????¨?????§???????????¨??????????????????
	long max=-1000001,min=1000001,sum=0;	
	scanf("%ld",&n);	//???????????¨%d????????????long?????????%ld

	for (i = 0; i < n; i++)	//n?????°?????????
	{
		scanf("%ld",&ai);	//n???ai?????\?????????
		
		if (max < ai)
		{
			max=ai;
		}
		if (min > ai)
		{
			min=ai;
		}
		
		sum+=ai;	//sum?????????????????§????????????
	}

	printf("%ld %ld %ld\n",min,max,sum);	//??????
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%ld",&n);        //???????????¨%d????????????long?????????%ld
      |         ^~~~~
a.cc:23:9: error: 'printf' was not declared in this scope
   23 |         printf("%ld %ld %ld\n",min,max,sum);    //??????
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
Language: C++

#include<stdio.h>
#include<ctype.h>
main(){
	char number[1001];
	int num,sum;
	int i;

	while(1){
		scanf("%s",number);
//		printf("%s\n",number);
		if(!(strcmp(number,"0"))) break;

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

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:22: error: 'strcmp' was not declared in this scope
   11 |                 if(!(strcmp(number,"0"))) break;
      |                      ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<ctype.h>
  +++ |+#include <cstring>
    3 | main(){
Language: C++

#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:
a.cc: In function 'int main()':
a.cc:31:31: error: 'stdin' was not declared in this scope
   31 | fgets(num_str,sizeof(num_str),stdin);
      |                               ^~~~~
a.cc:2:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<string.h>
  +++ |+#include <cstdio>
    2 | 
a.cc:31:1: error: 'fgets' was not declared in this scope
   31 | fgets(num_str,sizeof(num_str),stdin);
      | ^~~~~
a.cc:46:7: error: 'atoi' was not declared in this scope
   46 | num = atoi(&tmp);
      |       ^~~~
a.cc:55:1: error: 'printf' was not declared in this scope
   55 | printf("%ld\n",sum);
      | ^~~~~~
a.cc:55:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<stdlib.h>


#include<string.h>


int main(void)


{


char num_str[1002];


int num;


long sum = 0;


int i;


char tmp;


while (1)


{


f gets(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:
a.cc: In function 'int main()':
a.cc:34:1: error: 'f' was not declared in this scope
   34 | f gets(num_str, sizeof(num_str), stdin);
      | ^
a.cc:58:1: error: 'printf' was not declared in this scope
   58 | printf("%ld\n",sum);
      | ^~~~~~
a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    4 | #include<string.h>
  +++ |+#include <cstdio>
    5 |
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)


{


f gets(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:
a.cc: In function 'int main()':
a.cc:37:1: error: 'f' was not declared in this scope
   37 | f gets(num_str, sizeof(num_str), stdin);
      | ^
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)


{


f gets(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:
a.cc: In function 'int main()':
a.cc:37:1: error: 'f' was not declared in this scope
   37 | f gets(num_str, sizeof(num_str), stdin);
      | ^
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)

{

f gets(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:
a.cc: In function 'int main()':
a.cc:25:1: error: 'f' was not declared in this scope
   25 | f gets(num_str, sizeof(num_str), stdin);
      | ^
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 s=0;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'strlen' was not declared in this scope
   14 |                 for(int i=0;i<strlen(num);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<cstdio>
using namespace std;
 
int main()
{
	char num[1001];

	while(1){
		scanf("%s",num);//%s??????????????¨????????\??????????????¨?????¨???
		if(num[0] == '0') break;
		int s=0;

		for(int i=0;i<strlen(num);i++){//strlen??????????????????????????????????????´??????
			s += num[i] - '0';
		}
		printf("%d\n",s);
	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'strlen' was not declared in this scope
   14 |                 for(int i=0;i<strlen(num);i++){//strlen??????????????????????????????????????´??????
      |                               ^~~~~~
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 <cstdio>
#include<cctype>
#include<string>

using namespace std;

int main(){
	
	string s;
	
	while(1){
		cin >> s;
		
		if(s == "0") break;
		
		l = s.length();
		
		int sum = 0;
		for(int i = 0; i < l; i++)
			sum += s[i] - '0';
		
		cout << sum << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'l' was not declared in this scope
   17 |                 l = s.length();
      |                 ^
Language: C++

#include <iostream>
int main()
{
	int i=0,a,b=1,num,
	long long x[1000],sum[1000]={0};
	while(1)
	{
		std::cin>>b;
		if(b==0)break;
		x[i]=b;
		i++;
	}
	num=i;
	for(i=0;i<num;i++)
	{
		a=x[i];
		while(1){
			if(a==0)break;
			sum[i]+=a%10;
			a=a/10;
		}
	}
	for(i=0;i<num;i++){
		std::cout<<sum[i]<<std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected unqualified-id before 'long'
    5 |         long long x[1000],sum[1000]={0};
      |         ^~~~
a.cc:10:17: error: 'x' was not declared in this scope
   10 |                 x[i]=b;
      |                 ^
a.cc:16:19: error: 'x' was not declared in this scope
   16 |                 a=x[i];
      |                   ^
a.cc:19:25: error: 'sum' was not declared in this scope; did you mean 'num'?
   19 |                         sum[i]+=a%10;
      |                         ^~~
      |                         num
a.cc:24:28: error: 'sum' was not declared in this scope; did you mean 'num'?
   24 |                 std::cout<<sum[i]<<std::endl;
      |                            ^~~
      |                            num
Language: C++

#include <iostream>
int main()
{
	int i=0,a,b=1,num,x;
	long long x[1000],sum[1000]={0};
	while(1)
	{
		std::cin>>b;
		if(b==0)break;
		x[i]=b;
		i++;
	}
	num=i;
	for(i=0;i<num;i++)
	{
		a=x[i];
		while(1){
			if(a==0)break;
			sum[i]+=a%10;
			a=a/10;
		}
	}
	for(i=0;i<num;i++){
		std::cout<<sum[i]<<std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: conflicting declaration 'long long int x [1000]'
    5 |         long long x[1000],sum[1000]={0};
      |                   ^
a.cc:4:27: note: previous declaration as 'int x'
    4 |         int i=0,a,b=1,num,x;
      |                           ^
a.cc:10:18: error: invalid types 'int[int]' for array subscript
   10 |                 x[i]=b;
      |                  ^
a.cc:16:20: error: invalid types 'int[int]' for array subscript
   16 |                 a=x[i];
      |                    ^
Language: C++

#include <iostream>
#include<cstdio>
using namespace std;
 
int main()
{
	char num[1001];

	while(1){
		scanf("%s",num);//%s??????????????¨????????\??????????????¨?????¨???
		if(num[0] == '0') break;
		int s=0;

		for(int i=0;i<strlen(num);i++){//strlen??????????????????????????????????????´??????
			s += num[i] - '0';//??¢????????????????????§num?????????????????°??????????????????s????¶????
		}
		printf("%d\n",s);
	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'strlen' was not declared in this scope
   14 |                 for(int i=0;i<strlen(num);i++){//strlen??????????????????????????????????????´??????
      |                               ^~~~~~
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 <cmath>

#define MAX_SET (1000)

using namespace std;

int num_of_digit(int x);
int sum_of_digit(int x);

int main()
{  
    int size;

    int* x = new int[MAX_SET];
    int* sum = new int[MAX_SET];
    
    for (int i = 0; i < MAX_SET; i++) {
         do {
             cin >> x[i];            
         } while ((double)x[i] >= pow(10, 1000));
 
         if (x[i] == 0) {
	     break;
         } else {	   
	     sum[i] = sum_of_digit(x[i]);
         }
    }
  
    size = i;

    for (int i = 0; i < size; i++) {
         cout << sum[i] << endl;         
    }

    delete[] x;
    delete[] sum;
      
    return (0);
}

int num_of_digit(int x)
{
    int num = 1;
 
    while (x >= 10) {
           x /= 10;
           num++;
    }

    return (num);
}

int sum_of_digit(int x)
{
    int i;
    int sum = 0;  
    int divisor = pow(10, num_of_digit(x) - 1);

    while (x != 0) {
           sum += x / divisor;
           x %= divisor;           
           divisor /= 10;           
    }

    return (sum);   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: 'i' was not declared in this scope
   30 |     size = i;
      |            ^
Language: C++

#include <iostream>
#include <cstring>

#define MAX_SET (1000)
#define MAX_DIGIT (1000)

using namespace std;

int only_num(int x[]);

int main()
{
    int   size;

    char** x = new char*[MAX_SIZE + 1];

    for (int i = 0; i < MAX_SIZE + 1; i++) {
         x[i] = new char[MAX_DIGIT + 1];
    }

    int* sum = new int[MAX_SIZE + 1];

    for (int i = 0; i < MAX_SIZE + 1; i++) {
         do {
             cin >> x[i];
         } while (strlen(x[i]) > MAX_DIGIT || only_num(x[i]) == 0);

         if (strcmp(x[i], "0") == 0) {
             size = i;
             break;
         } else {
             for (int j = 0; x[i][j] != '\0'; j++) {
                  sum[i] += x[i][j] - '0';
             }
         } 
    }

    for (int i = 0; i < size; i++) {
         cout << sum[i] << endl;
    }
    
    for (int i = 0; i < MAX_SIZE + 1; i++) {
         delete[] x[i];
    }

    delete[] x;

    delete[] sum;

    return (0);
}

int only_num(char x[])
{
    int i;

    for (i = 0; x[i] != '\0'; i++) {
         if (x[i] < '0' || x[i] > '9') {
             break;
         }
    }

    if (x[i] == '\0') {
        return (1);
    } else {
        return (0);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: 'MAX_SIZE' was not declared in this scope
   15 |     char** x = new char*[MAX_SIZE + 1];
      |                          ^~~~~~~~
a.cc:26:59: error: cannot convert 'char*' to 'int*'
   26 |          } while (strlen(x[i]) > MAX_DIGIT || only_num(x[i]) == 0);
      |                                                        ~~~^
      |                                                           |
      |                                                           char*
a.cc:9:18: note:   initializing argument 1 of 'int only_num(int*)'
    9 | int only_num(int x[]);
      |              ~~~~^~~
Language: C++

#include <iostream>
#include <cstring>

#define MAX_SIZE (1000)
#define MAX_DIGIT (1000)

using namespace std;

int only_num(int x[]);

int main()
{
    int   size;

    char** x = new char*[MAX_SIZE + 1];

    for (int i = 0; i < MAX_SIZE + 1; i++) {
         x[i] = new char[MAX_DIGIT + 1];
    }

    int* sum = new int[MAX_SIZE + 1];

    for (int i = 0; i < MAX_SIZE + 1; i++) {
         do {
             cin >> x[i];
         } while (strlen(x[i]) > MAX_DIGIT || only_num(x[i]) == 0);

         if (strcmp(x[i], "0") == 0) {
             size = i;
             break;
         } else {
             for (int j = 0; x[i][j] != '\0'; j++) {
                  sum[i] += x[i][j] - '0';
             }
         } 
    }

    for (int i = 0; i < size; i++) {
         cout << sum[i] << endl;
    }
    
    for (int i = 0; i < MAX_SIZE + 1; i++) {
         delete[] x[i];
    }

    delete[] x;

    delete[] sum;

    return (0);
}

int only_num(char x[])
{
    int i;

    for (i = 0; x[i] != '\0'; i++) {
         if (x[i] < '0' || x[i] > '9') {
             break;
         }
    }

    if (x[i] == '\0') {
        return (1);
    } else {
        return (0);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:59: error: cannot convert 'char*' to 'int*'
   26 |          } while (strlen(x[i]) > MAX_DIGIT || only_num(x[i]) == 0);
      |                                                        ~~~^
      |                                                           |
      |                                                           char*
a.cc:9:18: note:   initializing argument 1 of 'int only_num(int*)'
    9 | int only_num(int x[]);
      |              ~~~~^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstlib>
using namespace std;
 
int main() {
  while (1) {
    char c;
    scanf("%c", &c);//???????????¨????????°??????????????????????????????
    int a = atoi(&c);//??°????????????????????°???????????????
    if (a == 0)
      return 0;
    while (1) {
      scanf("%c", &c);
      if (c == '\n') {
        cout << a << endl;
        break;
      }
      a += atoi(&c);
    }
  }

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

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

int main(){
     string number;
     while(1){
          cin>>number;
          if(number[0]-'0'==0) break;
          int sum=0;
          for(int i=0;i<number.size();i++)
          int num=number[i]-'0';
          sum+=num;
          }
     cout<<num<<endl;
}
          
     
     

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'num' was not declared in this scope; did you mean 'sum'?
   13 |           sum+=num;
      |                ^~~
      |                sum
a.cc:15:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   15 |      cout<<num<<endl;
      |            ^~~
      |            enum
Language: C++

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

int main(){
     string number;
     while(1){
          cin>>number;
          if(number[0]-'0'==0) break;
          int sum=0;
          for(int i=0;i<number.size();i++)
          int num=number[i]-'0';
          sum+=num;
          }
     cout<<sum<<endl;
}
          
     
     

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'num' was not declared in this scope; did you mean 'sum'?
   13 |           sum+=num;
      |                ^~~
      |                sum
a.cc:15:12: error: 'sum' was not declared in this scope
   15 |      cout<<sum<<endl;
      |            ^~~
Language: C++

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

int main(){
     string number;
     while(1){
          cin>>number;
          if(number[0]-'0'==0) break;
          int sum=0;
          for(int i=0;i<number.size();i++)
          int num=number[i]-'0';
          sum+=num;
         cout<<sum<<endl;
          }
}
          
     
     

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'num' was not declared in this scope; did you mean 'sum'?
   13 |           sum+=num;
      |                ^~~
      |                sum
Language: C++

#include <iostream>
#include <stdlib.h>

using namespace std;

int main() {

	char num[1000];
	int sum;
	int int_num;

	while (cin >> num) {

		sum = 0;

		cout << strlen(num) << endl;
		
		for (int i = 0; i < strlen(num); i++) {
			//cout << "num[i]=" << num[i] << endl;
			//cout << "(int)num[i]=" << (int)num[i] << endl;
			//cout << "int_num-(int)'0'=" << int_num-'0' << endl;
			sum += (int)num[i] - (int)'0';
		}

		cout << sum << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: 'strlen' was not declared in this scope
   16 |                 cout << strlen(num) << endl;
      |                         ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <stdlib.h>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <iostream>
#include <stdlib.h>
#include <cstring>

using namespace std;

int main() {

	char num[1000];
	int sum;
	int int_num;

	while (cin >> num) {

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

		sum = 0;

		cout << strlen(num) << endl;
		
		for (int i = 0; i < strlen(num); i++) {
			//cout << "num[i]=" << num[i] << endl;
			//cout << "(int)num[i]=" << (int)num[i] << endl;
			//cout << "int_num-(int)'0'=" << int_num-'0' << endl;
			sum += (int)num[i] - (int)'0';
		}

		cout << sum << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: 'i' was not declared in this scope
   15 |                 if ((int)num[i] - (int)'0' == 0) {
      |                              ^
Language: C++

#include <stdio.h>
int main (void){
int n=0;int a[]=0;int s;int b;int sum=0;
scanf("%d",&n);
for(int i=0;i<n;i++){scanf("%d ",&a[i]);}
for(int i=0;i<n;i++){if(s>a[i]){s=a[i];} if(b<a[i]){b=a[i];}sum+=a[i];}
printf("%d %d %d",s,b,sum);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: initializer fails to determine size of 'a'
    3 | int n=0;int a[]=0;int s;int b;int sum=0;
      |                 ^
a.cc:3:17: error: array must be initialized with a brace-enclosed initializer
Language: C++

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

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

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

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

#include <stdio.h>
int main(void)
{
int i,sum=0;
int flag=0;

char x[1002];
scanf("%s",x);
do{
for(i=0;i<1002;i++){
if(x[i]==0){
  printf("%d\n,sum);
  bresk;
}else{
sum+=x[i]-0X30;
}
}
sum=0;
scanf("%s",x);
}while(x[0]!=0X30);

return 0;
}

Compiler output:
a.cc:12:10: warning: missing terminating " character
   12 |   printf("%d\n,sum);
      |          ^
a.cc:12:10: error: missing terminating " character
   12 |   printf("%d\n,sum);
      |          ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:13:3: error: 'bresk' was not declared in this scope
   13 |   bresk;
      |   ^~~~~
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:
a.cc: In function 'int main()':
a.cc:18:2: error: 'inti' was not declared in this scope; did you mean 'int'?
   18 |  inti;
      |  ^~~~
      |  int
a.cc:21:6: error: 'i' was not declared in this scope
   21 |  for(i=0;i<1100;i++){
      |      ^
a.cc:48:10: error: 'i' was not declared in this scope
   48 |      for(i=0;str[i]!='\0';i++){
      |          ^
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int main() {
	char str[1001];
	int A;

	while(1){
		cin>>str;
		if (str[0]=='0')break;
		A=0;
		for (int i=0;i<strlen(str);i++){
			A+=(str[i]-'0');
		}
		cout<<A<<endl;
	}



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: 'strlen' was not declared in this scope
   21 |                 for (int i=0;i<strlen(str);i++){
      |                                ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <iostream>
  +++ |+#include <cstring>
   10 | #include <string>
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int main() {
	char str[1001];
	int A;

	while(1){
		cin>>str;
		if (str[0]=='0')break;
		A=0;
		int B=strlen(str);
		for (int i=0;i<B;i++){
			A+=(str[i]-'0');
		}
		cout<<A<<endl;
	}



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: 'strlen' was not declared in this scope
   21 |                 int B=strlen(str);
      |                       ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <iostream>
  +++ |+#include <cstring>
   10 | #include <string>
Language: C++

#include <iostream>
using namespace std;

int main() {
	char x[1000] = {};
	while (1) {
		cin >> x;
		int a = 0;
		if (x[0] == '0') break;
		for (int i = 0;i < strlen(x);i++) {
			if (x[i] == '\n') break;
			a += x[i] - '0';
		}
		cout << a << endl;
	}
}

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

#include <iostream>
#include <string>
using namespace std;
int main() {
	string s;
	int sum;
	while (1) {
		sum = 0;
		cin >> s;
		for (int i = 0; i < s.length();i++) {
			sum += s[i] - '';
		}
		if (!sum) break;
		cout << sum << endl;
	}
}

Compiler output:
a.cc:11:39: error: empty character constant
   11 |                         sum += s[i] - '';
      |                                       ^~
Language: C++

#include<iostream>
#include<string>
int main(void) {
	unsigned long long  Input = 0;
	while (1) {
		std::cin >> Input;
		if (Input == 0) { break; }
		std::string StringCalculate=to_string(Input);
		long Result = 0;
		for (int i = 0; i < StringCalculate.size(); ++i) {

			Result += StringCalculate[i]-'0';
		}
		std::cout << Result << std::endl;
	}
	//	system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:45: error: 'to_string' was not declared in this scope; did you mean 'std::__cxx11::to_string'?
    8 |                 std::string StringCalculate=to_string(Input);
      |                                             ^~~~~~~~~
      |                                             std::__cxx11::to_string
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4421:3: note: 'std::__cxx11::to_string' declared here
 4421 |   to_string(long double __val)
      |   ^~~~~~~~~
Language: C++

int main(void) {
		while (1) {
		std::string StringCalculate ;
		std::cin >> StringCalculate;
		if (StringCalculate == "0") { break; }		
		long Result = 0;
		for (unsigned int i = 0; i < StringCalculate.size(); ++i) {
						Result += StringCalculate[i] - '0';
		}
		std::cout << Result << std::endl;
	}
	system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:22: error: 'string' is not a member of 'std'
    3 |                 std::string StringCalculate ;
      |                      ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | int main(void) {
a.cc:4:22: error: 'cin' is not a member of 'std'
    4 |                 std::cin >> StringCalculate;
      |                      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(void) {
a.cc:4:29: error: 'StringCalculate' was not declared in this scope
    4 |                 std::cin >> StringCalculate;
      |                             ^~~~~~~~~~~~~~~
a.cc:10:22: error: 'cout' is not a member of 'std'
   10 |                 std::cout << Result << std::endl;
      |                      ^~~~
a.cc:10:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:45: error: 'endl' is not a member of 'std'
   10 |                 std::cout << Result << std::endl;
      |                                             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(void) {
a.cc:12:9: error: 'system' was not declared in this scope
   12 |         system("pause");
      |         ^~~~~~
Language: C++

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

int main(){
  int sum;
  while(1) {
    sum = 0;
    for(char c; c = getc(); c != '\n') {
      sum += c - 48;
    }
    cout << sum << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: too few arguments to function 'int getc(FILE*)'
   11 |     for(char c; c = getc(); c != '\n') {
      |                     ~~~~^~
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:576:12: note: declared here
  576 | extern int getc (FILE *__stream) __nonnull ((1));
      |            ^~~~