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

#include<stdio.h>
main(){
  int a=0;
  while(a<1000){
    printf("Hello World\n");
    n=n+1;
  }
  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:6:5: error: 'n' undeclared (first use in this function)
    6 |     n=n+1;
      |     ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
main(){
  int a=1000;
  while(a>0){
    printf("Hello World\n");
    a=a-1
      }
  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:6:10: error: expected ';' before '}' token
    6 |     a=a-1
      |          ^
      |          ;
    7 |       }
      |       ~
Language: C

include<stdio.h>
int main()
{
  int n=0;
  while(n<=100){
    puts("Hello World");
    n++;
  }
  return 0;
}

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

#include <stdio.h>

int main(void) {
	int a;
	for(i=0;i<1000;i++) printf("Hello World\n");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:13: error: 'i' undeclared (first use in this function)
    5 |         for(i=0;i<1000;i++) printf("Hello World\n");
      |             ^
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

main(i){for(;i++<1000;)printf("Hello World");i=0}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(i){for(;i++<1000;)printf("Hello World");i=0}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:24: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(i){for(;i++<1000;)printf("Hello World");i=0}
      |                        ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | main(i){for(;i++<1000;)printf("Hello World");i=0}
main.c:1:24: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    1 | main(i){for(;i++<1000;)printf("Hello World");i=0}
      |                        ^~~~~~
main.c:1:24: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:49: error: expected ';' before '}' token
    1 | main(i){for(;i++<1000;)printf("Hello World");i=0}
      |                                                 ^
      |                                                 ;
Language: C

i;main()for(i=1000;i--;)printf("Hello World");}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | i;main()for(i=1000;i--;)printf("Hello World");}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | i;main()for(i=1000;i--;)printf("Hello World");}
      |   ^~~~
main.c: In function 'main':
main.c:1:9: error: expected declaration specifiers before 'for'
    1 | i;main()for(i=1000;i--;)printf("Hello World");}
      |         ^~~
main.c:1:20: error: expected declaration specifiers before 'i'
    1 | i;main()for(i=1000;i--;)printf("Hello World");}
      |                    ^
main.c:1:24: error: expected declaration specifiers before ')' token
    1 | i;main()for(i=1000;i--;)printf("Hello World");}
      |                        ^
main.c:1:47: error: expected declaration specifiers before '}' token
    1 | i;main()for(i=1000;i--;)printf("Hello World");}
      |                                               ^
main.c:2: error: expected '{' at end of input
Language: C++

#include<stdio.h>
int main(void){
    int i;
    for (i = 1;ib <= 1000,i++){
        printf("Hello World\n")
    }
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:4:16: error: 'ib' was not declared in this scope; did you mean 'i'?
    4 |     for (i = 1;ib <= 1000,i++){
      |                ^~
      |                i
a.cc:4:30: error: expected ';' before ')' token
    4 |     for (i = 1;ib <= 1000,i++){
      |                              ^
      |                              ;
a.cc:5:32: error: expected ';' before '}' token
    5 |         printf("Hello World\n")
      |                                ^
      |                                ;
    6 |     }
      |     ~
Language: C++

tream>

using namespace std;

int main(void)
{
  for( int i = 0; i < 1000; i++ )
    cout << "Hello World" << endl;

  return 0;
}

Compiler output:
a.cc:1:1: error: 'tream' does not name a type
    1 | tream>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << "Hello World" << endl;
      |     ^~~~
a.cc:8:30: error: 'endl' was not declared in this scope
    8 |     cout << "Hello World" << endl;
      |                              ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
for(int i=0;i<1000;i++){
	printf("Hello World\n")
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: expected ';' before '}' token
    7 |         printf("Hello World\n")
      |                                ^
      |                                ;
    8 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

int main(){
for(int i = 0; i<1000; i++){
cout << "Hello World" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:2: error: expected '}' at end of input
    7 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

int main(int argc, char const *argv[])
{
  for (int i = 0; i < 1000; ++i)
  {
    puts("Hello World");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:5:5: error: 'puts' was not declared in this scope
    5 |     puts("Hello World");
      |     ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
for(int i=0;i<1000;i++>)
[cout<<"Hallo World"<<endl;]	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected primary-expression before ')' token
    8 | for(int i=0;i<1000;i++>)
      |                        ^
a.cc:9:2: warning: capture of variable 'std::cout' with non-automatic storage duration
    9 | [cout<<"Hallo World"<<endl;]
      |  ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::ostream std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:6: error: expected ',' before '<<' token
    9 | [cout<<"Hallo World"<<endl;]
      |      ^~
      |      ,
a.cc:9:6: error: expected identifier before '<<' token
    9 | [cout<<"Hallo World"<<endl;]
      |      ^~
a.cc:9:27: error: expected ']' before ';' token
    9 | [cout<<"Hallo World"<<endl;]
      |                           ^
      |                           ]
a.cc: In lambda function:
a.cc:9:27: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:9:28: error: expected primary-expression before ']' token
    9 | [cout<<"Hallo World"<<endl;]
      |                            ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
for(int i=0;i<1000; i++>)
{
cout<<"Hello World"<<endl;
}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected primary-expression before ')' token
    8 | for(int i=0;i<1000; i++>)
      |                         ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
for(int i=0;i<1000; i++>
{
cout<<"Hello World"<<endl;
}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before '{' token
    9 | {
      | ^
a.cc:8:25: error: expected ')' before '{' token
    8 | for(int i=0;i<1000; i++>
      |    ~                    ^
      |                         )
    9 | {
      | ~
Language: C++

class Main{
    public static void main(String args[]){
	for(int i=0;i<1000;i++){
	    System.out.println("Hello World");
	}
    }
}

Compiler output:
a.cc:2:11: error: expected ':' before 'static'
    2 |     public static void main(String args[]){
      |           ^~~~~~~
      |           :
a.cc:2:29: error: 'String' has not been declared
    2 |     public static void main(String args[]){
      |                             ^~~~~~
a.cc:7:2: error: expected ';' after class definition
    7 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:13: error: 'System' was not declared in this scope
    4 |             System.out.println("Hello World");
      |             ^~~~~~
Language: C++

#include <cstdio>
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <string> 
#include <vector> 
using namespace std;

int main(){
	for (int i = 1; i =< 1000; ++i)
	{
		cout << "Hello World" << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: expected primary-expression before '<' token
   10 |         for (int i = 1; i =< 1000; ++i)
      |                            ^
Language: C++

#include <cstdio>
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <string> 
#include <vector> 
using namespace std;

int main(){
	for (int i = 1; i =< 1000; i++)
	{
		cout << "Hello World" << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: expected primary-expression before '<' token
   10 |         for (int i = 1; i =< 1000; i++)
      |                            ^
Language: C++

using namespace std;

int main()
{
	int x, y, z, s, t;
	char a;

	for (x = 0; x < 1000; x++){
		cout << "Hello World" << endl;
	}


	return 0;
}

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

using namespace std;

int main()
{
	int x, y, z, s, t;
	char a;

	for (int i = 0; i < 1000; i++){
		cout << "Hello World" << endl;
	}
	return 0;
}

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

#include <iostream>
using namespace std;
	for(i=0;i<1001;i++){
	  Hello World;
}

Compiler output:
a.cc:3:9: error: expected unqualified-id before 'for'
    3 |         for(i=0;i<1001;i++){
      |         ^~~
a.cc:3:17: error: 'i' does not name a type
    3 |         for(i=0;i<1001;i++){
      |                 ^
a.cc:3:24: error: 'i' does not name a type
    3 |         for(i=0;i<1001;i++){
      |                        ^
Language: C++

#include <iostream>
using namespace std;
	for(i=0;i<1001;i++){
	  Hello World;
	return 0;
}

Compiler output:
a.cc:3:9: error: expected unqualified-id before 'for'
    3 |         for(i=0;i<1001;i++){
      |         ^~~
a.cc:3:17: error: 'i' does not name a type
    3 |         for(i=0;i<1001;i++){
      |                 ^
a.cc:3:24: error: 'i' does not name a type
    3 |         for(i=0;i<1001;i++){
      |                        ^
Language: C++

#include<iostream>

using namespace std;

int main()
{
for(i=0;i<1001;i++){
   Hello World;
}
       

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
    7 | for(i=0;i<1001;i++){
      |     ^
a.cc:8:4: error: 'Hello' was not declared in this scope; did you mean 'ftello'?
    8 |    Hello World;
      |    ^~~~~
      |    ftello
a.cc:9:2: error: expected '}' at end of input
    9 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <iostream>
using namespace std;
int main()
	for(i=0;i<1001;i++){
	  Hello World;
	return 0;
}

Compiler output:
a.cc:4:9: error: expected initializer before 'for'
    4 |         for(i=0;i<1001;i++){
      |         ^~~
a.cc:4:17: error: 'i' does not name a type
    4 |         for(i=0;i<1001;i++){
      |                 ^
a.cc:4:24: error: 'i' does not name a type
    4 |         for(i=0;i<1001;i++){
      |                        ^
Language: C++

#include<iostream>

using namespace std;

int main()
{
int i;
for(i=0;i<1001;i++)
{
cout<< "Hello World"<<
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: expected primary-expression before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

int main(){

for(i=1;i<1001;i++){
   Hello World;
}
       

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
    7 | for(i=1;i<1001;i++){
      |     ^
a.cc:8:4: error: 'Hello' was not declared in this scope; did you mean 'ftello'?
    8 |    Hello World;
      |    ^~~~~
      |    ftello
a.cc:9:2: error: expected '}' at end of input
    9 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;
int i;
	for(i=0;i<1000;i++){
	  Hello World;
	return 0;
}

Compiler output:
a.cc:4:9: error: expected unqualified-id before 'for'
    4 |         for(i=0;i<1000;i++){
      |         ^~~
a.cc:4:17: error: 'i' does not name a type
    4 |         for(i=0;i<1000;i++){
      |                 ^
a.cc:4:24: error: 'i' does not name a type
    4 |         for(i=0;i<1000;i++){
      |                        ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	for(i=0;i<1000;i++){
		cout<<"Hello World"<<endl;
		return 0;
	}
}

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

#include<stdio.h>
int main(){
  int i;
  for(n=0;n<1000;n++){
    printf("Hello World");
  }
  return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: 'n' was not declared in this scope
    4 |   for(n=0;n<1000;n++){
      |       ^
Language: C++

#include<stdio.h>
int main(){
  int i;
  for(i=0;i<1000;i++){
  printf("Hello World");
  return(0);
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:4: error: expected '}' at end of input
    7 |   }
      |    ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<stdio.h>
int main(){
  int i;
  for(i=0;i<1000;i++){
  printf("Hello World\n");
  return(0);
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:4: error: expected '}' at end of input
    7 |   }
      |    ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<iostream>
int main(){
  for(int i=0;i<1000;i++) cout << "Hello Wolrd" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:27: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    3 |   for(int i=0;i<1000;i++) cout << "Hello Wolrd" << endl;
      |                           ^~~~
      |                           std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:3:52: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    3 |   for(int i=0;i<1000;i++) cout << "Hello Wolrd" << endl;
      |                                                    ^~~~
      |                                                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>
int a(int x);

int main(){
  a(0);
}

int a(int x){ 
  if(x==1000) return;
  printf("Hello World\n");
  a(x+1);
}

Compiler output:
a.cc: In function 'int a(int)':
a.cc:9:15: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |   if(x==1000) return;
      |               ^~~~~~
a.cc:11:4: warning: control reaches end of non-void function [-Wreturn-type]
   11 |   a(x+1);
      |   ~^~~~~
Language: C++

#include<stdio.h>
int a(int x);
int main(){
  a(0);
}
int  a(int x){
  if(x==1000)return;
printf("Hello World\n");
  a(x+1);
}

Compiler output:
a.cc: In function 'int a(int)':
a.cc:7:14: error: return-statement with no value, in function returning 'int' [-fpermissive]
    7 |   if(x==1000)return;
      |              ^~~~~~
a.cc:9:4: warning: control reaches end of non-void function [-Wreturn-type]
    9 |   a(x+1);
      |   ~^~~~~
Language: C++

#include <stdio.h>

#define BUFMAX 15
int main(void){
  int i;
  char buf[BUFMAX]="Hello World";
  for(i=0;i<1000;i++){
    printf("%s\n",buf);
  }
  ret

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'ret' was not declared in this scope
   10 |   ret
      |   ^~~
a.cc:10:6: error: expected '}' at end of input
   10 |   ret
      |      ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include<iostream>

int main(void){
  for(int i=0;i<1000;i++) std::cout<<"Hello World"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:53: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |   for(int i=0;i<1000;i++) std::cout<<"Hello World"<<endl;
      |                                                     ^~~~
      |                                                     std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
int main(){
    for(int i = 0; i < 1000; i++)
        cout << "Hello World" << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 |         cout << "Hello World" << endl;
      |         ^~~~
      |         std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:4:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |         cout << "Hello World" << endl;
      |                                  ^~~~
      |                                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <stdio.h>

int main(){
	int 1;
	a=0;
	while(a < 101){
		printf("Hello World \n");
		a=a+1;
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: expected unqualified-id before numeric constant
    4 |         int 1;
      |             ^
a.cc:5:9: error: 'a' was not declared in this scope
    5 |         a=0;
      |         ^
Language: C++

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String arg[]) {
		for (int i = 0; i < 1000; ++i)
			System.out.println("Hello World");
	}
}

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

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

int main(void){
	int i,b;



	for(i = 0;i < 1000;i++){
		std::cout <<　"Hello World\n";
	}

	return 0;
}

Compiler output:
a.cc:12:29: error: extended character 　 is not valid in an identifier
   12 |                 std::cout <<　"Hello World\n";
      |                             ^
a.cc: In function 'int main()':
a.cc:12:29: error: '\U00003000' was not declared in this scope
   12 |                 std::cout <<　"Hello World\n";
      |                             ^~
Language: C++

#include<stdio.h>
int main(void)
{
int i=0;
while(i<1000)
{
printf("Hello World\n");
i=i+1
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected ';' before '}' token
    8 | i=i+1
      |      ^
      |      ;
    9 | }
      | ~
Language: C++

main(){register int a=0;while(1000-a++)puts("Hello World");exit(0);}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){register int a=0;while(1000-a++)puts("Hello World");exit(0);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    1 | main(){register int a=0;while(1000-a++)puts("Hello World");exit(0);}
      |                     ^
a.cc:1:40: error: 'puts' was not declared in this scope
    1 | main(){register int a=0;while(1000-a++)puts("Hello World");exit(0);}
      |                                        ^~~~
a.cc:1:60: error: 'exit' was not declared in this scope
    1 | main(){register int a=0;while(1000-a++)puts("Hello World");exit(0);}
      |                                                            ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | main(){register int a=0;while(1000-a++)puts("Hello World");exit(0);}
Language: C++

  int as[3];
  for(int i=0;i<3;i++)cin>>as[i];
  sort(as,as+3);
  cout<<as[0]<<" "<<as[1]<<" "<<as[2]<<endl;

Compiler output:
a.cc:2:3: error: expected unqualified-id before 'for'
    2 |   for(int i=0;i<3;i++)cin>>as[i];
      |   ^~~
a.cc:2:15: error: 'i' does not name a type
    2 |   for(int i=0;i<3;i++)cin>>as[i];
      |               ^
a.cc:2:19: error: 'i' does not name a type
    2 |   for(int i=0;i<3;i++)cin>>as[i];
      |                   ^
a.cc:3:7: error: expected constructor, destructor, or type conversion before '(' token
    3 |   sort(as,as+3);
      |       ^
a.cc:4:3: error: 'cout' does not name a type
    4 |   cout<<as[0]<<" "<<as[1]<<" "<<as[2]<<endl;
      |   ^~~~
Language: C++


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		for(int i=0; i<1000; i++){
			System.out.println("Hello World");
		}
		// TODO Auto-generated method stub

	}

}

Compiler output:
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
	for(int i = 0; io < 1000; i++)
		cout << "Hello World" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:7:24: error: 'io' was not declared in this scope; did you mean 'i'?
    7 |         for(int i = 0; io < 1000; i++)
      |                        ^~
      |                        i
Language: C++

#include <iostream>

using namespace std;

int main(){

for (int i=0; i<1000; i++1)
  {cout << "Hello World" << endl;}

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: expected ')' before numeric constant
    7 | for (int i=0; i<1000; i++1)
      |     ~                    ^
      |                          )
a.cc:7:27: error: expected ';' before ')' token
    7 | for (int i=0; i<1000; i++1)
      |                           ^
      |                           ;
Language: C++

#include<iostream>
using namespace std;

int main(){

	for(i=0;i<=1000;i++){
		cout<<"Hello World"<<endl;
}

return 0;
}

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

#include <iostream>
int main(){
for(int i=0;i<1000;i++)
std::cout << Hello World << "\n";
std::endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'Hello' was not declared in this scope; did you mean 'ftello'?
    4 | std::cout << Hello World << "\n";
      |              ^~~~~
      |              ftello
a.cc:5:10: error: statement cannot resolve address of overloaded function
    5 | std::endl;
      |          ^
Language: C++

#include <iostream>
int main(){
for(int i=0;i<1000;i++)
std::cout << "Hello World" << "\n";
std::endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: statement cannot resolve address of overloaded function
    5 | std::endl;
      |          ^
Language: C++

#include <iostream>
int main(){
for(int i=0;i<1000;i++)
std::cout << "Hello World" << "\n";
cout << std::endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 | cout << std::endl;
      | ^~~~
      | std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	for(i = 0; i < 1000; i++)
		cout << "Hello World" << endl;
	return 0;
}

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

#include <iostream>
using namespace std;
int main(){
	int i = 1;
	while(i <= 1000){　
		cout<<"Hello World"<<endl;
		i++;	
	}
	return 0;
}	

Compiler output:
a.cc:5:26: error: extended character 　 is not valid in an identifier
    5 |         while(i <= 1000){　
      |                          ^
a.cc: In function 'int main()':
a.cc:5:26: error: '\U00003000' was not declared in this scope
    5 |         while(i <= 1000){　
      |                          ^~
Language: C++

#include<iosteream>
using namespace std;

int main()
{
  int i
    for(i=0;i<1000;i+=i){
      cout<<"Hello World\n"<<endl;
    }
}

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

#include<iosteream>
using namespace std;

int main()
{
  int i
    for(i=0;i<1000;i+=i){
      cout<<"Hello World"<<endl;
    }
}

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

#include<stdio.h>
int main(void)
{
	int a=0;
	
	while(1)
	{
		if(a<1000)
		{
			printf("Hello World\n");
		}
		
		else if(a=1001)
		{
			break;
		}
		
		a++;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected '}' at end of input
   19 |         }
      |          ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

main(){for(int i = 0 ; i < 1000 ; i++ ) printf("Hello World\n");}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){for(int i = 0 ; i < 1000 ; i++ ) printf("Hello World\n");}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:41: error: 'printf' was not declared in this scope
    1 | main(){for(int i = 0 ; i < 1000 ; i++ ) printf("Hello World\n");}
      |                                         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){for(int i = 0 ; i < 1000 ; i++ ) printf("Hello World\n");}
Language: C++

#include<iostream>
int main(){
int n=1000;
while(n--)std::cout<<"Hello World"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 | while(n--)std::cout<<"Hello World"<<endl;
      |                                     ^~~~
      |                                     std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>

using namespace std;

int main()
{
	for(int i = 0; i < 1000; ++i) {
		cout << "Hello World" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout << "Hello World" << endl;
      |                 ^~~~
a.cc:16:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   15 | #include <functional>
  +++ |+#include <iostream>
   16 |
Language: C++

int main() {
    // your code goes here
    for (int i = 0;i<1000;i++) {
        cout << "Hello World\n" << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cout' was not declared in this scope
    4 |         cout << "Hello World\n" << endl;
      |         ^~~~
a.cc:4:36: error: 'endl' was not declared in this scope
    4 |         cout << "Hello World\n" << endl;
      |                                    ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(void){
    for(int i=0; i<999 i++){
    cout <<"Hello World";
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: expected ';' before 'i'
    5 |     for(int i=0; i<999 i++){
      |                       ^~
      |                       ;
Language: C++

#include <iostream>
using namespace std

int main(){
	for(int i = 0; i < 1000; i++){
		cout << "Hello World" << endl;
	}
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main(){
      | ~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	for(p=0; p < 1000; p++){
cout << "Hello World\n"

}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: 'p' was not declared in this scope
    5 |         for(p=0; p < 1000; p++){
      |             ^
a.cc:6:24: error: expected ';' before '}' token
    6 | cout << "Hello World\n"
      |                        ^
      |                        ;
    7 | 
    8 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

int main() {
int p
	for(p=0; p < 1000; p++){
cout << "Hello World\n"

}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'for'
    6 |         for(p=0; p < 1000; p++){
      |         ^~~
a.cc:6:18: error: 'p' was not declared in this scope
    6 |         for(p=0; p < 1000; p++){
      |                  ^
Language: C++

#include <iostream>
using namespace std;

int main() {
           int p
	for( p=0 ; p < 1000 ; p++){
cout << "Hello World\n"

}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'for'
    6 |         for( p=0 ; p < 1000 ; p++){
      |         ^~~
a.cc:6:20: error: 'p' was not declared in this scope
    6 |         for( p=0 ; p < 1000 ; p++){
      |                    ^
Language: C++

#include <iostream>
using namespace std;

int main() {
           int p;
	for( p=0 ; p < 1000 ; p++){
cout << "Hello World\n"

}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected ';' before '}' token
    7 | cout << "Hello World\n"
      |                        ^
      |                        ;
    8 | 
    9 | }
      | ~
Language: C++

#include <iostream>

int main(void)
{
for (int i = 0; i < 1000; i++){
cout << "Hello World!" << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | cout << "Hello World!" << endl;
      | ^~~~
      | std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 | cout << "Hello World!" << endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java


import java.util.Scanner;

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

		while(true){
			int x = sc.nextInt();
			int y = 0;

			if (x==0) {
				break;
			}

			for(int i = 1000; i > 0; i--){

				if((int)Math.pow(10, i - 1) <= x && x < (int)Math.pow(10, i)){
					int a = x / (int)Math.pow(10, i - 1);
					int b =	x % (int)Math.pow(10, i - 1);
					y = y + a;
					x = b;
				}
			}

			System.out.printf("%d\n",z);
		}
	}
}

Compiler output:
Main.java:26: error: cannot find symbol
			System.out.printf("%d\n",z);
			                         ^
  symbol:   variable z
  location: class Main
1 error
Language: Java

package ????????°???????????°A;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int m;
		int num = 0;
		while (true) {
			m = scanner.nextInt();
			num = 0;
			if (m == 0) {
				break;
			}

			while (m != 0) {
				num += m % 10;
				m /= 10;

			}
			System.out.println(num);
		}
		scanner.close();
	}
}

Compiler output:
Main.java:1: error: <identifier> expected
package ?????????????????????A;
       ^
Main.java:1: error: illegal character: '\u00b0'
package ?????????????????????A;
                ^
Main.java:1: error: illegal character: '\u00b0'
package ?????????????????????A;
                            ^
3 errors
Language: Java

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

public class Main{
	  public static void main(String[] args) {

		while(true){
		String n;
	    int ans=0;
	  

	    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	    try {
	        

	        
		    n = reader.readLine();

		    int leng = n.length();
		    
	        for(int i=0;i<leng;i++){
	        String N = n.substring(i,i+1);
	        int num = new Integer(N).intValue();
	        ans=ans+num;
	        }
		    if(leng==1&&ans==0){
		    	System.exit(0);
		    }
	        System.out.println(ans);
	      }
	      catch (NumberFormatException e) {
	      System.out.println(e);
	    } catch (IOException e) {
	      System.out.println(e);
	    }
	  }
	    }

Compiler output:
Main.java:38: error: reached end of file while parsing
	    }
	     ^
1 error
Language: Java



import java.util.Scanner;

 

public class Main{

public static void main(String[] args){

	int sum,i;

	String x;

	Scanner sc = new Scanner(System.in);

	while(true){
		sum=0

	        x=sc.next();

		if(x=="0"){

			break;

		}

		for(i=0;i<x.length();i++){

			sum+=x.charAt(i)-'0';

		}
		System.out.printf("%d\n",sum);

	}

	

 

}

}

Compiler output:
Main.java:18: error: ';' expected
		sum=0
		     ^
1 error
Language: Java


import java.util.Scanner;


public class Main{
public static void main(String[] args){
	int sum,i;
	String x;
	Scanner sc = new Scanner(System.in);
	while(true){
		sum=0;
	        x=sc.next();
		if(x.equals"0"){
			break;
		}
		for(i=0;i<x.length();i++){
			sum+=x.charAt(i)-'0';
		}
		System.out.printf("%d\n",sum);
	}

}
}

Compiler output:
Main.java:13: error: ')' expected
		if(x.equals"0"){
		           ^
Main.java:13: error: ';' expected
		if(x.equals"0"){
		              ^
2 errors
Language: Java

import java.util.Scanner;
public class Keta{
	public static void main(String[]args){
		Scanner sc = new Scanner(System.in);
		int s;
		while(true){
			s = 0;
			int x = sc.nextInt();
			if(x == 0 || x > 9999){
				break;
			}
				else if(x < 10 && x > 0){
					System.out.printf("%d\n",x);
				}
				else if(x <100 && x >= 10){
					while(true){
						x = x-10;
						s++;
						if(x < 10){
							break;
						}
					}
					System.out.printf("%d\n",s+x);
				}	
				else if(x < 1000 && x >= 100){
					while(true){
						x = x-100;
						s++;
						if(x < 100){
							break;
						}
					}
					while(true){
						if(x < 10){
							break;
						}
						x = x-10;
						s++;
					}
					System.out.printf("%d\n",s+x);
				}
			else if(x < 10000 && x >= 1000){
				while(true){
					x = x-1000;
					s++;
					if(x < 1000){
						break;
					}
				}
				while(true){
					if(x < 100){
						break;
					}
					x = x - 100;
					s++;
				}
				while(true){
					if(x < 10){
						break;
					}
					x = x - 10;
					s++;
				}
				System.out.printf("%d\n",s+x);
			}
		}
	}
}

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

import java.util.Scanner;

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

        for (x = input.nextInt(); x != 0; x = input.nextInt()){
            int sum = 0;

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

Compiler output:
Main.java:8: error: incompatible types: int cannot be converted to String
        for (x = input.nextInt(); x != 0; x = input.nextInt()){
                              ^
Main.java:8: error: bad operand types for binary operator '!='
        for (x = input.nextInt(); x != 0; x = input.nextInt()){
                                    ^
  first type:  String
  second type: int
Main.java:8: error: incompatible types: int cannot be converted to String
        for (x = input.nextInt(); x != 0; x = input.nextInt()){
                                                           ^
3 errors
Language: Java

import java.util.Scanner;

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

        for (x = input.nextInt(); !x.equals("0"); x = input.nextInt()){
            int sum = 0;

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

Compiler output:
Main.java:8: error: incompatible types: int cannot be converted to String
        for (x = input.nextInt(); !x.equals("0"); x = input.nextInt()){
                              ^
Main.java:8: error: incompatible types: int cannot be converted to String
        for (x = input.nextInt(); !x.equals("0"); x = input.nextInt()){
                                                                   ^
2 errors
Language: Java

import java.util.Scanner;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int sum=0;


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



            }
            System.out.printf("%d\n",x);
            x = sc.nextInt();
        }

    }


}
    


    

Compiler output:
Main.java:12: error: ';' expected
                x=x/10
                      ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int x =sc.nextInt();
int sum;

for(;;){
	if(x==0) break;

 sum = 0;
	for(;x==0;){
		sum+=x%10;
		x=x/10;
	}
	System.out.println{sum};
}
}
}

Compiler output:
Main.java:20: error: not a statement
	System.out.println{sum};
	          ^
Main.java:20: error: ';' expected
	System.out.println{sum};
	                  ^
Main.java:20: error: not a statement
	System.out.println{sum};
	                   ^
Main.java:20: error: ';' expected
	System.out.println{sum};
	                      ^
4 errors
Language: Java

import java.util.Scanner;

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

		while(true){
			String value = sc.next();
			if(value.charAt(0) == 0) break;
			int sum = 0;
			for(int i=0; i<value.length; i++){
				int ch = value.charAt(i);
				sum += ch -'0';
			}
		}

	}
}

Compiler output:
Main.java:11: error: cannot find symbol
			for(int i=0; i<value.length; i++){
			                    ^
  symbol:   variable length
  location: variable value of type String
1 error
Language: Java

impimport java.util.Scanner;

public class keta {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

for(;;){

int x = sc.nextInt();
int sum;


	if(x==0) break;

 sum = 0;
	for(;x!=0;){
		sum+=x%10;
		x=x/10;
	}
	System.out.println(sum);
}
}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
impimport java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;

public class keta {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

for(;;){

int x = sc.nextInt();
int sum;


	if(x==0) break;

 sum = 0;
	for(;x!=0;){
		sum+=x%10;
		x=x/10;
	}
	System.out.println(sum);
}
}
}

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

import java.io.*;
public class plus{
    public static void main(String[] args){
	int sum = 0;
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	try{
	    while(sum <= 1000){
		String line = reader.readLine();
		if(line == "0"){
		    break;
		}
		for(int i = 0; i < line.length(); i++){
		    char ch = line.charAt(i);
		    try{
			sum += Character.getNumericValue(ch);
		    } catch(NumberFormatException e) {
		    }
		}
		System.out.println(sum);
		sum = 0;
	    }
	} catch (IOException e){
	    System.out.println(e);
	}
    }
}

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

import java.io.*;

public class plus{
    public static void main(String[] args){
	int sum = 0;
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	try{
	    while(sum <= 1000){
		String line = reader.readLine();
		if(line == "0"){
		    break;
		}
		for(int i = 0; i < line.length(); i++){
		    char ch = line.charAt(i);
		    try{
			sum += Character.getNumericValue(ch);
		    } catch(NumberFormatException e) {
		    }
		}
		System.out.println(sum);
		sum = 0;
	    }
	} catch (IOException e){
	    System.out.println(e);
	}
    }
}

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

import java.io.*;
public class plus{
    public static void main(String[] args){
	int sum = 0;
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	try{
	    while(sum <= 1000){
		String line = reader.readLine();
		if(line.equals("0")){
		    break;
		}
		for(int i = 0; i < line.length(); i++){
		    char ch = line.charAt(i);
		    try{
			sum += Character.getNumericValue(ch);
		    } catch(NumberFormatException e) {
		    }
		}
		System.out.println(sum);
		sum = 0;
	    }
	} catch (IOException e){
	    System.out.println(e);
	}
    }
}

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

import java.io.*;
 
public class Main{
    public static void main(String[] args){
        int sum = 0;
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
       
         while(true){
                String line = reader.readLine();
                char a = line.charAt(0);

                if(a == '0'){
                    break;
                }
                for(int i = 0;i < line.length();i++){
                    a = line.charAt(i);
                    if(a - '0' == 0){
                    }else if(a - '1' == 0){
                        sum = sum + 1;
                    }else if(a - '2' == 0){
                        sum = sum + 2;
                    }else if(a - '3' == 0){
                        sum = sum + 3;
                    }else if(a - '4' == 0){
                        sum = sum + 4;
                    }else if(a - '5' == 0){
                        sum = sum + 5;
                    }else if(a - '6' == 0){
                        sum = sum + 6;
                    }else if(a - '7' == 0){
			sum = sum + 7;
                    }else if(a - '8' == 0){
                        sum = sum + 8;
                    }else{
                        sum = sum + 9;
		    }
                }
                System.out.println(sum);
                sum = 0;
	 }
    }
}

Compiler output:
Main.java:9: error: unreported exception IOException; must be caught or declared to be thrown
                String line = reader.readLine();
                                             ^
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;  //To use Array List 

public class SumN{
 public static void main(String[] args){
  Scanner sc=new Scanner(System.in);
   //ArrayList needn't declare the size of array
  ArrayList<String> N = new ArrayList<String>(); 

  int i=0,j=0;
  String N_tmp;

  //Repeat adding Integer to ArrayN until 0 is added to ArrayN 
  do{
   N_tmp=sc.next();
   N.add(i,N_tmp);
   i++;
  }while(!N.get(i-1).equals("0"));

  //variable for calculation sum of N's each digit
  int sum_N=0;

  //N[0]~N[end]: caluculate sum of each digit
  for(j=0;j<i-1;j++){
   sum_N=0;
   String N_rls = N.get(j);
   int k=0;
   do{
    sum_N+=(int)N_rls.charAt(k)-(int)'0';  //String changes to int
    k++;
   }while(k<N_rls.length());   //length of string

   //Output each the result
   System.out.println(sum_N);
  }
 }
}

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

import java.io.*;

public class Main{
    public static void main(String[] args){
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	while(true){
	    int sum = 0;
	    String line = reader.readLine();
	    int l = line.length();
	    for(int i=0;i<l;i++){
		char c = line.charAt(i);
		sum+=c - '0';
	    }
	    if(sum == 0) break;
	    System.out.println(sum);
	}	
    }
}

Compiler output:
Main.java:8: error: unreported exception IOException; must be caught or declared to be thrown
	    String line = reader.readLine();
	                                 ^
1 error