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

public class Main { 
   long number; 
   public main(long number){ 
      setNumber(number); 
   } 

   public long addNumbers(){ 
      long number = this.number; 
      long sum = 0; 
       
      number = Math.abs(number); 
       
      do { 
         sum += number % 10; 
      } while((number /= 10) != 0); 
       
      return sum; 
   } 
    
   public void setNumber(long number){ 
      this.number = number; 
   } 
    
   public long getNumber(){ 
      return number; 
   } 
} 

Compiler output:
Main.java:3: error: invalid method declaration; return type required
   public main(long number){ 
          ^
1 error
Language: Java

public class Main{ 
  public static void main(String[] args) { 
    Scanner sc = new Scanner(System.in);
    while(true){
      int x = sc.nextInt();
      if(x==0) break;
      int k=0;
      int t = x;
      while(t>0){
        t /= 10;
        k++;
      }
      int S3 = 0;
      int [] S;
      int [] S2;
      S = new int [10000];
      S2 = new int [10000];
      int i = k-1;
      S2[k]=x;
      while(i>=0){
        while(true){
          S[i]=S2[i+1]/(int)Math.pow(10,i);
          if(S[i]==0){
            S2[i]=S2[i+1];
            i--;
            break;
          }
          else if(S[i]!=0){
            S2[i]=S2[i+1]-S[i]*(int)Math.pow(10,i);
            S3 = S3 + S[i];
            i--;
            break;
          }
        }
      }
      System.out.printf("%d\n",S3);
    }
  }
}
    

Compiler output:
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.io.*;
class Main{
 public static void main(String[] args)throws IOException{

InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
int[] arr = new int[1000];
while(true){
int ans = 0;
String str = br.readLine();
if(str.equals("0")
 break;
for(int i = 0; i < str.length(); i++){
 ans += str.charAt(i) - '0';
}
System.out.println(ans);
}
}
}

Compiler output:
Main.java:11: error: ')' expected
if(str.equals("0")
                  ^
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    while((String str = sc.next()).equals("0")) {
      int cnt = 0;
      for (int i = 0; i < str.length(); i++) {
        cnt += str.charAt(i) - "0";
      }
      System.out.println(cnt);
    }
  }
}

Compiler output:
Main.java:5: error: ',', ')', or '[' expected
    while((String str = sc.next()).equals("0")) {
                     ^
Main.java:5: error: illegal start of expression
    while((String str = sc.next()).equals("0")) {
                      ^
Main.java:5: error: illegal start of expression
    while((String str = sc.next()).equals("0")) {
                                  ^
Main.java:5: error: ';' expected
    while((String str = sc.next()).equals("0")) {
                                              ^
4 errors
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    while(true) {
      String str = sc.next();
      if (str.equals("0")) {
        break;
      }
      int cnt = 0;
      for (int i = 0; i < str.length(); i++) {
        cnt += str.charAt(i) - "0";
      }
      System.out.println(cnt);
    }
  }
}

Compiler output:
Main.java:12: error: bad operand types for binary operator '-'
        cnt += str.charAt(i) - "0";
                             ^
  first type:  char
  second type: String
1 error
Language: Java

import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) throws IOException{
InputStreamReader(System.in));
		Scanner in = new Scanner(System.in);
		while(true){
			int ans = 0;
			String line = in.next();
			if(line.equals("0")) break;
			char ch[] = line.toCharArray();
			for(int i=0; i<ch.length; i++){
				ans = ans + (int)ch[i] - 48;
			}
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:5: error: ';' expected
InputStreamReader(System.in));
                            ^
1 error
Language: Java

import java.util.*;

public class main {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
    	
    	while (1) {
    		String input = scanner.nextLine();
    		if (input.equals('0')) {
    			break;
    		}
        	int output = 0;
	        for (int i = 0; i < input.length(); i++) {
	        	ouput += Integer.perseInt(input.charAt(i));
	        }
	        System.out.println(output);
    	}
    }
}

Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:7: error: incompatible types: int cannot be converted to boolean
    	while (1) {
    	       ^
Main.java:14: error: cannot find symbol
	        	ouput += Integer.perseInt(input.charAt(i));
	        	^
  symbol:   variable ouput
  location: class main
Main.java:14: error: cannot find symbol
	        	ouput += Integer.perseInt(input.charAt(i));
	        	                ^
  symbol:   method perseInt(char)
  location: class Integer
4 errors
Language: Java

import java.util.*;
import java.lang.*;

public class main {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
    	
    	while (true) {
                scanner.reset();
    		String input = scanner.next();
    		if (input.equals("0")) {
    			break;
    		}
        	int output = 0;
	        for (int i = 0; i < input.length(); i++) {
	        	output += Integer.parseInt(String.valueOf(input.charAt(i)));
	        }
	        System.out.println(output);
    	}
    }
}

Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

import java.util.*;
import java.lang.*;

public class 10019 {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
    	
    	while (true) {
                scanner.reset();
    		String input = scanner.next();
    		if (input.equals("0")) {
    			break;
    		}
        	int output = 0;
	        for (int i = 0; i < input.length(); i++) {
	        	output += String.valueOf(input.charAt(i));
	        }
	        System.out.println(output);
    	}
    }
}

Compiler output:
Main.java:4: error: <identifier> expected
public class 10019 {
            ^
1 error
Language: Java

package jp.waseda.ruri.nnujabok;

import java.util.Scanner;

public class Main2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String x = sc.next();
		while (x.equals("0") != true) {
			int sum = 0;
			for (int i = 0; i < x.length(); i++) {
				sum += Integer.parseInt(Character.toString(x.charAt(i)));
			}
			System.out.println(sum);
			x = sc.next();
		}
	}
}

Compiler output:
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

import com.google.common.base.Objects;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.eclipse.xtext.xbase.lib.Exceptions;

@SuppressWarnings("all")
public class Main {
  public static void main(final String... args) {
    try {
      InputStreamReader _inputStreamReader = new InputStreamReader(System.in);
      BufferedReader _bufferedReader = new BufferedReader(_inputStreamReader);
      final BufferedReader br = _bufferedReader;
      String str = br.readLine();
      boolean _notEquals = (!Objects.equal(str, "0"));
      boolean _while = _notEquals;
      while (_while) {
        {
          final char[] s = str.toCharArray();
          int ans = 0;
          for (final char c : s) {
            int _minus = (c - '0');
            int _plus = (ans + _minus);
            ans = _plus;
          }
          System.out.println(ans);
        }
        boolean _notEquals_1 = (!Objects.equal(str, "0"));
        _while = _notEquals_1;
      }
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
}

Compiler output:
Main.java:1: error: package com.google.common.base does not exist
import com.google.common.base.Objects;
                             ^
Main.java:4: error: package org.eclipse.xtext.xbase.lib does not exist
import org.eclipse.xtext.xbase.lib.Exceptions;
                                  ^
Main.java:14: error: cannot find symbol
      boolean _notEquals = (!Objects.equal(str, "0"));
                             ^
  symbol:   variable Objects
  location: class Main
Main.java:27: error: cannot find symbol
        boolean _notEquals_1 = (!Objects.equal(str, "0"));
                                 ^
  symbol:   variable Objects
  location: class Main
Main.java:31: error: cannot find symbol
      throw Exceptions.sneakyThrow(_e);
            ^
  symbol:   variable Exceptions
  location: class Main
5 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

@SuppressWarnings("all")
public class Main {
  public static void main(final String[] args) {
    try {
      InputStreamReader _inputStreamReader = new InputStreamReader(System.in);
      BufferedReader _bufferedReader = new BufferedReader(_inputStreamReader);
      final BufferedReader br = _bufferedReader;
      String str = br.readLine();
      boolean _notEquals = (!Objects.equal(str, "0"));
      boolean _while = _notEquals;
      while (_while) {
        {
          final char[] s = str.toCharArray();
          int ans = 0;
          for (final char c : s) {
            int _minus = (c - '0');
            int _plus = (ans + _minus);
            ans = _plus;
          }
          System.out.println(ans);
        }
        boolean _notEquals_1 = (!Objects.equal(str, "0"));
        _while = _notEquals_1;
      }
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
}

Compiler output:
Main.java:12: error: cannot find symbol
      boolean _notEquals = (!Objects.equal(str, "0"));
                             ^
  symbol:   variable Objects
  location: class Main
Main.java:25: error: cannot find symbol
        boolean _notEquals_1 = (!Objects.equal(str, "0"));
                                 ^
  symbol:   variable Objects
  location: class Main
Main.java:29: error: cannot find symbol
      throw Exceptions.sneakyThrow(_e);
            ^
  symbol:   variable Exceptions
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Main1 {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		char[] number;
		number = new char[1001];
		int num = 0;
		int ans = 0;

		while (true) {
			String keta = s.next();
			number=keta.toCharArray();
			for (int i = 0; i < number.length; i++) {
				num = number[i] - '0';
				ans += num;
			}

			if (number[0] == '0')
				break;
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		while (true){
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int a,sum=0;
			while(true){
				a = n%10;
				sum += a;
				n = n/10;
				System.out.println(sum);
				if(n < 1)break;
			}	
		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
			Scanner sc = new Scanner(System.in);
			^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
			Scanner sc = new Scanner(System.in);
			                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class aoj10019 {
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		while(true){
			int count = 0;
			String n = in.next();
			char[] c = n.toCharArray();
			if(c[0] == '0') break;
			for(int i = 0;i < c.length;i++){
				int a = Integer.parseInt(""+c[i]);
				count = count + a;
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:3: error: class aoj10019 is public, should be declared in a file named aoj10019.java
public class aoj10019 {
       ^
1 error
Language: C

#include <stdio.h>
#include <ctype.h>

int main(void){
	unsigned long int x[256]
	int i, j, ans;
	for(i = 0; 1 ; i++){
		scanf("%d", &x[i]);
		if(x[i] == 0){
			break;
		}
	}

	for(i = 0; 1 ; i++){
		if(x[i] == 0)
			break;
		ans = 0;
		for(j = 0; 1 ; j++){
			ans += x[i] % 10;
			x[i] /= 10;
			if(x[i] == 0){
				printf("%d\n", ans);
				break;
			}
		}
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:33: error: expected ';' before 'int'
    5 |         unsigned long int x[256]
      |                                 ^
      |                                 ;
    6 |         int i, j, ans;
      |         ~~~                      
main.c:8:30: error: 'x' undeclared (first use in this function)
    8 |                 scanf("%d", &x[i]);
      |                              ^
main.c:8:30: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void)
{
	int x[10000];
	int i, j;
	int r, m, n;
	int sum[10000];
	
	i = 0;
	
	while (1) {
		scanf("%d", &x[i]);
		
		if (x[i] == 0) {
			break;
		
		sum[i] = 0;
		
		while (x[i] != 0) {
			r = x[i] % 10;
			sum[i] += r;
			x[i] = x[i] / 10;
		}
		
		
		i++;
	}
	
	for(j = 0; j < i; j++) {
		printf("%d\n", sum[j]);
	}
	
	return (0);

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

#include<stdio.h>

int main(void)
{
	int x[10000];
	int i, j;
	int r, m, n;
	int sum[10000];
	
	i = 0;
	sum[i] = 0;
	
	while (1) {
		scanf("%d", &x[i]);
		
		if (x[i] == 0) {
			break;
		
		while (x[i] != 0) {
			r = x[i] % 10;
			sum[i] += r;
			x[i] = x[i] / 10;
		}
		
		
		i++;
	}
	
	for(j = 0; j < i; j++) {
		printf("%d\n", sum[j]);
	}
	
	return (0);
}

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

#include<stdio.h>
int main()
{
	int b, a=0, x[1500]={}, c=8;
	int ans=0, sum;
	char n[10000]={};
	while(1) {
		scanf("%s",&n);
		if (n[1]==0) break;
		for (sum=0;n[sum]=='\0';sum++) {
			printf("%c\n",n[sum]);
		}
		printf("%d\n",ans);
		ans=0;
	}
	return 0;
}
#include<stdio.h>
int main()
{
	char n[1500]={};
	int a, b, c, ans=0, x[1500]={};
	while (1) {
		scanf("%s",&n);
		if (n[0]=='0') break;
		for (a=0;n[a]!='\0';a++) {
			for (b=0;b<10;b++) {
				if (n[a]=='1'+b) { 
				x[a]=1+b;
				}
			}
		}
		for (c=0;x[c]!=0;c++) {
			ans=ans+x[c];
		}
		printf("%d\n",ans);
		ans=0;
		char n[1500]={};
		int x[1500]={};
}
	return 0;
}

Compiler output:
main.c:19:5: error: redefinition of 'main'
   19 | int main()
      |     ^~~~
main.c:2:5: note: previous definition of 'main' with type 'int()'
    2 | int main()
      |     ^~~~
Language: C

#include<stdio.h>
int main()
{
	int b, a=0, x[1500]={}, c=8;
	int ans=0, sum;
	char n[10000]={};
	while(1) {
		scanf("%s",&n);
		if (n[1]==0) break;
		for (sum=0;n[sum]=='\0';sum++) {
			printf("%c\n",n[sum]);
		}
		printf("%d\n",ans);
		ans=0;
	}
	return 0;
}
#include<stdio.h>
int main()
{
	char n[1500]={};
	int a, b, c, ans=0, x[1500]={};
	while (1) {
		scanf("%s",&n);
		if (n[0]=='0') break;
		for (a=0;n[a]!='\0';a++) {
			for (b=0;b<10;b++) {
				if (n[a]=='1'+b) { 
				x[a]=1+b;
				}
			}
		}
		for (c=0;x[c]!=0;c++) {
			ans=ans+x[c];
		}
		printf("%d\n",ans);
		ans=0;
		char n[1500]={};
		int x[1500]={};
	}
	return 0;
}

Compiler output:
main.c:19:5: error: redefinition of 'main'
   19 | int main()
      |     ^~~~
main.c:2:5: note: previous definition of 'main' with type 'int()'
    2 | int main()
      |     ^~~~
Language: C

#include <stdio.h>

int main(void)
{

  int x;
    scanf("%d",&x);
    if(x==0)break;
    int s = 0;
    for(;;){
      if(x==0)break;
      s += x%10;
      x /= 10;
    }
    printf("%d\n",s);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: break statement not within loop or switch
    8 |     if(x==0)break;
      |             ^~~~~
Language: C

#include <stdio.h>

int main(void){

  int i;
  long long long long int n;

  for(;;){
    int s=0;
    scanf("%d",&n);
    if(n==0)break;

    for(;;){
      if (n==0)break;
      s += n%10;
      n = n/10;
    }

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

    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: 'long long long' is too long for GCC
    6 |   long long long long int n;
      |             ^~~~
main.c:6:18: error: 'long long long' is too long for GCC
    6 |   long long long long int n;
      |                  ^~~~
Language: C

#include<stdio.h>

char a[1000];
int b[1000000000];
int i;
int i2;
int owari=-1;
int he(char a){
if(a=='0')return 0;
if(a=='1')return 1;
if(a=='2')return 2;
if(a=='3')return 3;
if(a=='4')return 4;
if(a=='5')return 5;
if(a=='6')return 6;
if(a=='7')return 7;
if(a=='8')return 8;
if(a=='9')return 9;
else return 0;
}
int main(){
	for(i=0;owari==-1;i++){
		scanf("%s",a);
		b[i]=0;
		if(a[0]=='0')owari=i;
		for(i2=0;i2<1000;i2++){
			b[i]+=he(a[i2]);
			a[i2]='0';
		}
	}
	for(i=0;i<owari;i++){
		printf("%d\n",b[i]);
	}
	return 0;	
}

Compiler output:
/tmp/ccDsSDUx.o: in function `main':
main.c:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0xc5): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0xee): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0xfa): relocation truncated to fit: R_X86_64_PC32 against symbol `i2' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x106): relocation truncated to fit: R_X86_64_PC32 against symbol `i2' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x123): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x15b): relocation truncated to fit: R_X86_64_PC32 against symbol `i2' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x16e): relocation truncated to fit: R_X86_64_PC32 against symbol `i2' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x177): relocation truncated to fit: R_X86_64_PC32 against symbol `i2' defined in .bss section in /tmp/ccDsSDUx.o
main.c:(.text+0x17d): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>

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

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

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

Compiler output:
main.c: In function 'main':
main.c:8:26: error: invalid operands to binary - (have 'int' and 'char *')
    8 |                 if (a[0] - "0"== 0)
      |                     ~~~~ ^
      |                      |   |
      |                      |   char *
      |                      char
main.c:10:29: warning: comparison between pointer and integer
   10 |                 for(i=0;a[i]!=NULL;i++){
      |                             ^~
Language: C

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

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

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

    if(x==0){
      break;
    }
    p=0;k=0;
    while(x>0){
      k=x%10;
      x=x/10;
      p=p+k;
    }
    printf("%d\n",p);
  }
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main() {
      | ^~~~
main.c: In function 'main':
main.c:5:20: error: stray '#' in program
    5 |     scanf("%d",&x);#include<stdio.h>
      |                    ^
main.c:5:21: error: 'include' undeclared (first use in this function)
    5 |     scanf("%d",&x);#include<stdio.h>
      |                     ^~~~~~~
main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:29: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
    5 |     scanf("%d",&x);#include<stdio.h>
      |                             ^~~~~
      |                             stdin
main.c:6:7: error: expected ';' before '{' token
    6 | main() {
      |       ^~
      |       ;
Language: C

#include <stdio.h>

int main(void){
         char number[1000]; 
         int sum;
        while(1){
            sum =0;
          scanf("%s",number);
              if( number[0] == '0')
                  break;
           for( i = 0; i<1000; i++){
                 sum += (number[i]-'0');
              }
               printf("%d",num);
}
            
           

Compiler output:
main.c: In function 'main':
main.c:11:17: error: 'i' undeclared (first use in this function)
   11 |            for( i = 0; i<1000; i++){
      |                 ^
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:28: error: 'num' undeclared (first use in this function); did you mean 'sum'?
   14 |                printf("%d",num);
      |                            ^~~
      |                            sum
main.c:15:1: error: expected declaration or statement at end of input
   15 | }
      | ^
Language: C

#include <stdio.h>

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

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

#include <stdio.h>
#define MAX 1001

int main() {
  int x, i, num;
  char s[MAX];

  while(1) {
    num = 0;
    fgets(s, MAX, stdin);
    for(i = 0; s[i] != '\n'; i++) {
      if(s[0] == '0') {
	return 0;
      }
      num += s[i] - '0';
    }
    printf("%d\n", sum);
  }  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:20: error: 'sum' undeclared (first use in this function); did you mean 'num'?
   17 |     printf("%d\n", sum);
      |                    ^~~
      |                    num
main.c:17:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:8:28: error: 's' undeclared (first use in this function)
    8 |         while (scanf("%s", s) != EOF){
      |                            ^
main.c:8:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:8:31: error: 'a' undeclared (first use in this function)
    8 |             while(scanf("%d",&a) != EOF)
      |                               ^
main.c:8:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:5: error: expected declaration or statement at end of input
   16 |     }
      |     ^
Language: C

include <stdio.h>

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

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

}

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

#include<stdio.h>
int main(void)
{
  char s[1000],sum,i;

  for(scanf(scanf("%s",&s)!=EOF){

    for(i=0;i<1000;i++)
      (int)s[i]-=48;

    for(i=0;i<1000;i++)
      sum+=s[i];
    printf("%d",sum);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:27: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    6 |   for(scanf(scanf("%s",&s)!=EOF){
      |                           ^
      |                           |
      |                           int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:6:33: error: expected ';' before '{' token
    6 |   for(scanf(scanf("%s",&s)!=EOF){
      |                                 ^
      |                                 ;
main.c:17:1: error: expected expression before '}' token
   17 | }
      | ^
main.c:17:1: error: expected expression before '}' token
main.c:17:1: error: expected expression before '}' token
Language: C

#include<stdio.h>
int main(void)
{
  char s[1000];
  int i;

  for(scanf("%s",&s)!=EOF){

    int sum=0;
    for(i=0;i<1000;i++)
      (int)s[i]-=48;

    for(i=0;i<1000;i++)
      sum+=s[i];
    printf("%d",sum);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:26: error: expected ';' before ')' token
    7 |   for(scanf("%s",&s)!=EOF){
      |                          ^
main.c:7:26: error: expected expression before ')' token
main.c:11:16: error: lvalue required as left operand of assignment
   11 |       (int)s[i]-=48;
      |                ^~
Language: C

#include<stdio.h>
int main(void)
{
  char s[1000];
  int i;

  for(;;){

    int sum=0;

    scanf("%s",&s);

    for(i=0;i<1000;i++)
      (int)s[i]-=48;

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

    if(sum==0)
      break;

    printf("%d",sum);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:16: error: lvalue required as left operand of assignment
   14 |       (int)s[i]-=48;
      |                ^~
Language: C

#include<stdio.h>
int main(void)
{
  char s[1000]={0};
  int i;

  for(;;){

    int sum=0;

    scanf("%s",&s);

    for(i=0;i<1000;i++)
      sum+=s[i]-4７;

    if(sum==0)
      break;

    printf("%d",sum);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:17: error: invalid suffix "７" on integer constant
   14 |       sum+=s[i]-4７;
      |                 ^~~
Language: C

#include<stdio.h>
int main(void)
{
  char s[1000]={'\0'};
  int i;

  for(;;){

    int sum=0;

    scanf("%s",&s);

    for(i=0;i<1000;i++){
      sum+=s[i]-47;

    if(sum==0)
      break;

    printf("%d",sum);
  }

  return 0;
}

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

#include<stdio.h>
int main(void)
{
  char s[1000]={'\0'};
  int i;

  for(;;){

    int sum=0;

    scanf("%s",&s);

    for(i=0;i<1000;i++){
      sum+=s[i]-48;

    if(sum==0)
      break;

    printf("%d",sum);
  }

  return 0;
}

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

#include <stdio.h>

int main(void) {
	char num[1001];
	int n[1001],i=tmp=0,j;
	while(1) {
		scanf("%s",num);
		if(num[0]=='0') break;
		else while(isdigit(num[i]==0)) {
			n[i]=num[i]-'0';
			i++;
		}
		for(j=0;j<i;j++) tmp+=n[j];
		printf("%d\n",tmp);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:23: error: 'tmp' undeclared (first use in this function)
    5 |         int n[1001],i=tmp=0,j;
      |                       ^~~
main.c:5:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:28: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
    9 |                 else while(isdigit(num[i]==0)) {
      |                            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | #include <stdio.h>
  +++ |+#include <ctype.h>
    2 |
Language: C++

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

int main()
{
    char x[1000];
    for (cin >> x; strcmp(x,"0"); cin >> x) {
        int result=0;
        for (int i=0; x[i]; i++) {
            char tmp[]={x[i], '\0'};
            result+=atoi(tmp);
        }
        cout << result << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'strcmp' was not declared in this scope
    8 |     for (cin >> x; strcmp(x,"0"); cin >> x) {
      |                    ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdlib>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

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

int main()
{
    char x[1000];
    for (cin >> x; strcmp(x,"0"); cin >> x) {
        int result=0;
        for (int i=0; x[i]; i++) {
            char tmp[]={x[i], '\0'};
            result+=atoi(tmp);
        }
        cout << result << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'strcmp' was not declared in this scope
    8 |     for (cin >> x; strcmp(x,"0"); cin >> x) {
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main()
{
    char x[1000];
    for (cin >> x; strcmp(x,"0")!=0; cin >> x) {
        int result=0;
        for (int i=0; x[i]; i++) {
            char tmp[]={x[i], '\0'};
            result+=atoi(tmp);
        }
        cout << result << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'strcmp' was not declared in this scope
    8 |     for (cin >> x; strcmp(x,"0")!=0; cin >> x) {
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main()
{
    char x[1000];
    for (cin >> x; strcmp(x,"0")!=0; cin >> x) {
        int result=0;
        for (int i=0; x[i]; i++) {
            char tmp[]={x[i], '\0'};
            result+=atoi(tmp);
        }
        cout << result << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'strcmp' was not declared in this scope
    9 |     for (cin >> x; strcmp(x,"0")!=0; cin >> x) {
      |                    ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio>

using namespace std;

int main(void){
	while (true){
		int a, b, c, d, n;
		scanf("%d",&n);
		if (n == 0) break;
		a = n / 1000;
		n = n - a * 1000;
		b = n / 100;
		n = n - b * 100;
		c = n / 10;
		n = n - c * 10;
		d = n;
		cout << a + b + c + d << endl;
	}
}

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

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

using namespace std;

int main(void){
	while (true){
		int n, ans=0;
		scanf("%d",&n);
		if (n == 0) break;
		double log = log10(n);
		for (int i = 1; i <= log + 1; i++) {
			int ten = 1;
			for (int j = 0; j <= log - i; j++) ten = ten * 10;
			ans = ans + (n / ten);
			n = n - ten*(n / ten);
		}
		cout << ans << endl;
	}
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int i,l,n,sum;
		String str;
		sum = 0;
		Scanner sc= new Scanner(System.in);
		while(true){
			str = sc.nextLine();
			n = Integer.parseInt(str);
			if(n == 0) break;
			l = str.length();
			for(i = 0; i < l; i++){
				sum += (str.charAt(i) - '0');
			}
			System.out.println(sum);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;

class Main {
    public static void main(String args[]){
        Scanner input = new Scanner(System.in);
        String x;

        for (x = input.next(); x.charAt(0) != '0'; x = input.next()){
            int sum = 0;

            for (int i = 0; i < x.length(); i++){
                sum += x.charAt(i) - '0';
            }
            System.out.println(sum);
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String args[]){
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String args[]){
      |                             ^~~~~~
a.cc:17:2: error: expected ';' after class definition
   17 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
    5 |         Scanner input = new Scanner(System.in);
      |         ^~~~~~~
a.cc:6:9: error: 'String' was not declared in this scope
    6 |         String x;
      |         ^~~~~~
a.cc:8:14: error: 'x' was not declared in this scope
    8 |         for (x = input.next(); x.charAt(0) != '0'; x = input.next()){
      |              ^
a.cc:8:18: error: 'input' was not declared in this scope; did you mean 'int'?
    8 |         for (x = input.next(); x.charAt(0) != '0'; x = input.next()){
      |                  ^~~~~
      |                  int
a.cc:14:13: error: 'System' was not declared in this scope
   14 |             System.out.println(sum);
      |             ^~~~~~
Language: C++

#include<stdio.h>
int main(){
  int a,b=0,len;
  char s[1000];
  while(1){
    scanf("%s",&s);
    len=strlen(s);
    for(a=0;a<len;a++){
      b+=s[a]-48;
    }
    printf("%d\n",b);
    if(s[0]==0){
      break;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'strlen' was not declared in this scope
    7 |     len=strlen(s);
      |         ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | int main(){
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int n;
	while(cin>>n,n){
		int sum=0;
		while(n){
			sum+=n%10
			n/=10;
		}
		cout<<sum<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:34: error: expected ';' before 'n'
   27 |                         sum+=n%10
      |                                  ^
      |                                  ;
   28 |                         n/=10;
      |                         ~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
	int x1,x2,y1,y2;
	double a=0;
	cin>>x1>>y1>>x2>>y2;
	a=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
	a=(double)sqrt((double)a);
	cout<<a;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'sqrt' was not declared in this scope
   11 |         a=(double)sqrt((double)a);
      |                   ^~~~
Language: C++

#include <cstdio>
#include <cctype>
#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'cin' was not declared in this scope
   12 |                 cin >> s;
      |                 ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <string>
  +++ |+#include <iostream>
    4 | 
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout << n << endl;
      |                 ^~~~
a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:30: error: 'endl' was not declared in this scope
   18 |                 cout << n << endl;
      |                              ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <string>
  +++ |+#include <ostream>
    4 |
Language: C++

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

int main()
{

	char input[5];
	int n,sum;
	while (cin >> input)
	{
		if (input == "0")
			break;

		sum = 0;
		n = strlen(input);

		for (int i = 0; i < n; i++) {
			sum += (int)input[n - i-1]-48;
		}
		cout << sum << endl;
		
	}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'strlen' was not declared in this scope
   16 |                 n = strlen(input);
      |                     ^~~~~~
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 | #include <string>
Language: C++

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

int main()
{
	
	char input[5];
	int n,sum;
	while (cin >> input)
	{
		if (input[0] == '0')
			break;

		sum = 0;
		n = strlen(input);

		for (int i = 0; i < n; i++) {
			sum += (int)input[n - i-1]-48;
		}
		cout << sum << endl;
		
	}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'strlen' was not declared in this scope
   16 |                 n = strlen(input);
      |                     ^~~~~~
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 | #include <string>
Language: C++

#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

int main()
{
	
	char input[5];
	int n,sum;
	while (cin >> input)
	{
		if (input[0] == '0')
			break;

		sum = 0;
		n = strlen(input);

		for (int i = 0; i < n; i++) {
			sum += (int)input[n - i-1]-48;
		}
		cout << sum << endl;
		
	}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: 'strlen' was not declared in this scope
   17 |                 n = strlen(input);
      |                     ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <stdlib.h>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

int main(){
    while (1){
	char n[1001];
	cin >> n;
	if (strlen(n) == 1 && n[0] == '0') break;

	int sum = 0;
	for (int i = 0; n[i] != '\0'; i++) sum += n[i] - '0';
	printf("%d\n", sum);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'strlen' was not declared in this scope
    8 |         if (strlen(n) == 1 && n[0] == '0') break;
      |             ^~~~~~
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>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: 'number' was not declared in this scope
   10 | if(number==0){break;}
      |    ^~~~~~
a.cc:13:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   13 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: 'number' was not declared in this scope
   10 | if(number==0){break;}
      |    ^~~~~~
a.cc:13:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   13 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:4: error: 'number' was not declared in this scope
   11 | if(number==0){break;}
      |    ^~~~~~
a.cc:14:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   14 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()
Language: C++

#include <iostream>
using namespace std;

int main()
{
int x;
string n;
while(true)
{
x=0;
cin>>x;
if(number==0){break;}
else
{
for(int i=0;i<n.size;i++)
{
x += n[i]-'0';
}
cout<<x<<endl;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: 'number' was not declared in this scope
   12 | if(number==0){break;}
      |    ^~~~~~
a.cc:15:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   15 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()
Language: C++

#include <iostream>
using namespace std;

int main()
{
int x;
string n;
while(true)
{
x=0;
cin>>n;
if(number==0){break;}
else
{
for(int i=0;i<n.size;i++)
{
x += n[i]-'0';
}
cout<<x<<endl;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: 'number' was not declared in this scope
   12 | if(number==0){break;}
      |    ^~~~~~
a.cc:15:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   15 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()
Language: C++

#include <iostream>
using namespace std;

int main()
{
int x;
string n;
while(true)
{
x=0;
cin>>n;
if(number==0){break;}

for(int i=0;i<n.size;i++)
{
x += n[i]-'0';
}
cout<<x<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: 'number' was not declared in this scope
   12 | if(number==0){break;}
      |    ^~~~~~
a.cc:14:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   14 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()
Language: C++

int main()
{
int x;
string n;
while(true)
{
x=0;
cin>>n;
if(number=="0"){break;}

for(int i=0;i<n.size;i++)
{
x += n[i]-'0';
}
cout<<x<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
    4 | string n;
      | ^~~~~~
a.cc:8:1: error: 'cin' was not declared in this scope
    8 | cin>>n;
      | ^~~
a.cc:8:6: error: 'n' was not declared in this scope
    8 | cin>>n;
      |      ^
a.cc:9:4: error: 'number' was not declared in this scope
    9 | if(number=="0"){break;}
      |    ^~~~~~
a.cc:15:1: error: 'cout' was not declared in this scope
   15 | cout<<x<<endl;
      | ^~~~
a.cc:15:10: error: 'endl' was not declared in this scope
   15 | cout<<x<<endl;
      |          ^~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
int x;
string n;
while(true)
{
x=0;
cin>>n;
if(number=="0"){break;}

for(int i=0;i<n.size;i++)
{
x += n[i]-'0';
}
cout<<x<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: 'number' was not declared in this scope
   12 | if(number=="0"){break;}
      |    ^~~~~~
a.cc:14:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   14 | for(int i=0;i<n.size;i++)
      |               ~~^~~~
      |                     ()