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

#include<iostream> 
#include<string>
#include<cctype> using namespace std;
int main()

{ 
    string a,b; 
    getline(cin, a); 
for(int i=0;i<a.size();i++){ 
    if(islower(a[i])){ b += toupper(a[i]); 
    
} 
else if(isupper(a[i])){ b += tolower(a[i]);
} 
else{ b += a[i]; 
    
} 
    
}
cout<<b<<endl; 
return 0;

    
} 


Compiler output:
a.cc:3:18: warning: extra tokens at end of #include directive
    3 | #include<cctype> using namespace std;
      |                  ^~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string a,b;
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     getline(cin, a);
      |             ^~~
      |             std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:18: error: 'a' was not declared in this scope
    8 |     getline(cin, a);
      |                  ^
a.cc:10:24: error: 'b' was not declared in this scope
   10 |     if(islower(a[i])){ b += toupper(a[i]);
      |                        ^
a.cc:13:25: error: 'b' was not declared in this scope
   13 | else if(isupper(a[i])){ b += tolower(a[i]);
      |                         ^
a.cc:15:7: error: 'b' was not declared in this scope
   15 | else{ b += a[i];
      |       ^
a.cc:20:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 | cout<<b<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:7: error: 'b' was not declared in this scope
   20 | cout<<b<<endl;
      |       ^
a.cc:20:10: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 | cout<<b<<endl;
      |          ^~~~
      |          std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main()
{
string line;
getline(cin,line);
for(int i=0;i<line.size(char);i++){
     char a;
     if(line[i]>=43&&line[i]<=58){
          a=line[i]+32;
     }
     else if(line[i]>=65&&line[i]<=90){
          a=line[i]-32;
     } 
     else{
          a=line[i];
     }
     cout << a:
}
cout << endl;

return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected primary-expression before 'char'
   10 | for(int i=0;i<line.size(char);i++){
      |                         ^~~~
a.cc:21:15: error: expected ';' before ':' token
   21 |      cout << a:
      |               ^
      |               ;
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    int count = 0
    while(1){
        char a;
        cin >> a;
        if (a == "\n"){break;}
        if (int isalpha(char a)){
            if (int islower(char a)){
                a = toupper(a);
            }else{
                a = tolower(a);
            };
        }
        str[count] = a;
        count+=1;
    }
    for(int i = 0; i <=count; i++){
        cout << str[i];
        if (i == count){
            cout << endl;
        }
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: expected ',' or ';' before 'while'
   26 |     while(1){
      |     ^~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    int count = 0;
    while(1){
        char a;
        cin >> a;
        if (a == "\n"){break;}
        if (int isalpha(char a)){
            if (int islower(char a)){
                a = toupper(a);
            }else{
                a = tolower(a);
            };
        }
        str[count] = a;
        count+=1;
    }
    for(int i = 0; i <=count; i++){
        cout << str[i];
        if (i == count){
            cout << endl;
        }
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |         if (a == "\n"){break;}
      |             ~~^~~~~~~
a.cc:30:17: error: condition declares a function
   30 |         if (int isalpha(char a)){
      |                 ^~~~~~~
a.cc:31:21: error: condition declares a function
   31 |             if (int islower(char a)){
      |                     ^~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    int count = 0;
    while(1){
        char a;
        cin >> a;
        if (a == "\n"){
            break;
        }
        if (int isalpha(char a)){
            if (int islower(char a)){
                a = toupper(a);
            }else{
                a = tolower(a);
            };
        }
        str[count] = a;
        count+=1;
    }
    for(int i = 0; i <=count; i++){
        cout << str[i];
        if (i == count){
            cout << endl;
        }
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |         if (a == "\n"){
      |             ~~^~~~~~~
a.cc:32:17: error: condition declares a function
   32 |         if (int isalpha(char a)){
      |                 ^~~~~~~
a.cc:33:21: error: condition declares a function
   33 |             if (int islower(char a)){
      |                     ^~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    int count = 0;
    while(1){
        char a;
        cin >> a;
        if (a == '\n'){
            break;
        }
        if (int isalpha(char a)){
            if (int islower(char a)){
                a = toupper(a);
            }else{
                a = tolower(a);
            };
        }
        str[count] = a;
        count+=1;
    }
    for(int i = 0; i <=count; i++){
        cout << str[i];
        if (i == count){
            cout << endl;
        }
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: condition declares a function
   32 |         if (int isalpha(char a)){
      |                 ^~~~~~~
a.cc:33:21: error: condition declares a function
   33 |             if (int islower(char a)){
      |                     ^~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    while (1){
        char s;
        cin >> s;
        if (s == "\n"){
            break;
        }
        char output;
        output = s;
        if (isalpha(s)){
            if(islower(s)){
                output = toupper(s);
            }else{
                output = tolower(s);
            }
        }
        str[i] = output;
    }
    int count =0;
    while(1){
        cout << str[count];
        if (str[i] == "\n"){
            break;
        }else{
            count += 1;
        }
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |         if (s == "\n"){
      |             ~~^~~~~~~
a.cc:40:13: error: 'i' was not declared in this scope
   40 |         str[i] = output;
      |             ^
a.cc:45:17: error: 'i' was not declared in this scope
   45 |         if (str[i] == "\n"){
      |                 ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    while (1){
        char s;
        cin >> s;
        if (s == "\n"){
            break;
        }
        char output;
        output = s;
        if (isalpha(s)){
            if(islower(s)){
                output = toupper(s);
            }else{
                output = tolower(s);
            }
        }
        str[i] = output;
    }
    int count =0;
    while(1){
        cout << str[count];
        if (str[count] == "\n"){
            break;
        }else{
            count += 1;
        }
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |         if (s == "\n"){
      |             ~~^~~~~~~
a.cc:40:13: error: 'i' was not declared in this scope
   40 |         str[i] = output;
      |             ^
a.cc:45:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   45 |         if (str[count] == "\n"){
      |             ~~~~~~~~~~~^~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    while (1){
        char s;
        cin >> s;
        if (s == '\n'){
            break;
        }
        char output;
        output = s;
        if (isalpha(s)){
            if(islower(s)){
                output = toupper(s);
            }else{
                output = tolower(s);
            }
        }
        str[i] = output;
    }
    int count =0;
    while(1){
        cout << str[count];
        if (str[count] == '\n'){
            break;
        }else{
            count += 1;
        }
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:13: error: 'i' was not declared in this scope
   40 |         str[i] = output;
      |             ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    int word = 0;
    while (1){
        char s;
        cin >> s;

        char output;
        output = s;
        if (isalpha(s)){
            if(islower(s)){
                output = toupper(s);
            }else{
                output = tolower(s);
            }
        }
        str[word] = output;
        mojisu +=1;
        if (s == '\n'){
            break;
        }
    }
    int count = 0;
    while(1){
        cout << str[count];
        if (str[count] == '\n'){
            break;
        }else{
            count += 1;
        }
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'mojisu' was not declared in this scope
   40 |         mojisu +=1;
      |         ^~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
    char str[1300];
    int word = 0;
    while (1){
        char s;
        scanf("%c",&s);
        char output;
        output = s;
        if (isalpha(s)){
            if('a' <= ch && ch <= 'z'){
                output = toupper(s);
            }else{
                output = tolower(s);
            }
        }
        str[word] = output;
        word +=1;
        if (s == '\n'){
            break;
        }
    }
    int count = 0;
    cout << "convert"<< endl;
    while(1){

        if (str[count] == '\n'){
            break;
        }else{
            cout << str[count];
            count += 1;
        }
    }

    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:23: error: 'ch' was not declared in this scope
   32 |             if('a' <= ch && ch <= 'z'){
      |                       ^~
Language: C++

#include<bits.stdc++.h>
using namespace std;

int main(){
	
	string mozi;
	
	getline(cin,mozi);
	
	for(int i=0;(int)mozi.size();i++){
		
	if(islower(mozi[i])){
		mozi[i] = toupper(mozi[i]);
	}	
	else if(isupper(mozi[i])){
		mozi[i] = tolower(mozi[i]);
	}
	return 0;
}


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

#include<bits/stdc++.h>
using namespace std;

int main(){
	
	string mozi;
	
	getline(cin,mozi);
	
	for(int i=0;(int)mozi.size();i++){
		
	if(islower(mozi[i])){
		mozi[i] = toupper(mozi[i]);
	}	
	else if(isupper(mozi[i])){
		mozi[i] = tolower(mozi[i]);
	}
	return 0;
}


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

#include <iostream>
using namespace std;

int main() {
char ch;

while(1){
    scanf("%c", &ch);
    if(int islower(char ch)){
    	cout <<int toupper(char ch);
    }
    else if(int isupper(char ch)){
    	cout << int tolower(char ch);
    }
    if ( ch == '\n' ) break;
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: condition declares a function
    9 |     if(int islower(char ch)){
      |            ^~~~~~~
a.cc:10:16: error: expected primary-expression before 'int'
   10 |         cout <<int toupper(char ch);
      |                ^~~
a.cc:12:17: error: condition declares a function
   12 |     else if(int isupper(char ch)){
      |                 ^~~~~~~
a.cc:13:17: error: expected primary-expression before 'int'
   13 |         cout << int tolower(char ch);
      |                 ^~~
Language: C++

#include <iostream>

using namespace std;

int main(){
 	char ch;
	while(1){
            scanf("%c", &ch);
	    if(islower(ch)){
		ch=toupper(ch);
		cout << ch;
}           else if(isupper(ch)){
		ch=tolower(ch);
		cout << ch;
}	    else if(ch=="\n") break;
	    else {cout << ch;	}
}
	cout << endl;

    return 0;
}

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

#include <iostream>

using namespace std;

int main(){
 	char ch;
	while(1){
            scanf("%c",&ch);
if(ch == '\n'){
	 break;
}
	    if(islower(ch)){
		cout << toupper(ch);
}           else if(isupper(ch){
		cout << tolower(ch);
}	    
	    else {cout << ch;}
}
	cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: expected ')' before '{' token
   14 | }           else if(isupper(ch){
      |                    ~           ^
      |                                )
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

int main(){
 	char ch;
	while(1){
            scanf("%c",&ch);
if(ch == '\n'){
	 break;
}
	    if(islower(ch)){
		cout << (char)toupper(ch);
}           else if(isupper(ch){
		cout << (char)tolower(ch);
}	    
	    else {cout << ch;}
}
	cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: expected ')' before '{' token
   14 | }           else if(isupper(ch){
      |                    ~           ^
      |                                )
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

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

int main(){
 	char ch;
	while(1){
            scanf("%c",&ch);
if(ch == '\n'){
	 break;
}
	    if(islower(ch)){
		cout << (char)toupper(ch);
}           else if(isupper(ch){
		cout << (char)tolower(ch);
}	    
	    else {cout << ch;}
}
	cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: expected ')' before '{' token
   14 | }           else if(isupper(ch){
      |                    ~           ^
      |                                )
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

int main(){
 	char ch;
	while(1){
            scanf("%c",&ch);
if(ch == '\n') break;
	    if(islower(ch)) cout << (char)toupper(ch);
            else if(isupper(ch) cout << (char)tolower(ch);
	    else cout << ch;
}
	cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'cout'
   11 |             else if(isupper(ch) cout << (char)tolower(ch);
      |                                ^~~~~
      |                                ;
a.cc:12:13: error: expected primary-expression before 'else'
   12 |             else cout << ch;
      |             ^~~~
a.cc:11:59: error: expected ')' before 'else'
   11 |             else if(isupper(ch) cout << (char)tolower(ch);
      |                    ~                                      ^
      |                                                           )
   12 |             else cout << ch;
      |             ~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
string se,moto;
int a=0,i=0;
cin>> moto;
for(i=0;i<moto.length();i++){
if(isupper(moto[i])){
moto[i]=tolower(moto[i]);
}
}
while(1){
cin >> se;
for(i=0;i<se.length();i++){
if(isupper(se[i])){
se[i]=tolower(se[i]);
}
if (se == "END_OF_TEXT"){
break;
}
if(se==moto){
a=a+1;
}
}
cout << a << endl;
    return 0;
}

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

#include<iostream>
int main(){
	char s[1200 + 1];
	int i=0;
	std::cin >> s;
	while (s[i] != '\0'){
		if (s[i] >= 65 && s[i] <= 90)s[i] += 32;
		else (s[i] >= 97 && s[i] <= 122)s[i] -= 32;
		++i;
	}
	std::cout << s << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:49: error: expected ';' before 's'
    8 |                 else (s[i] >= 97 && s[i] <= 122)s[i] -= 32;
      |                                                 ^
      |                                                 ;
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cctype>

using namespace std;

int main(void){
  char in[1201];
  int len, j;

  j = 0;
  while(true){  
    scanf("%c", &in[j]);
    if(in[j] == '\n'){
      in[j + 1] = '\0'
      break;
    }
    j++;
  }
  
  len = strlen(in);
  for(int i = 0; i < len; i++){
    if(islower(in[i])){
      in[i] = toupper(in[i]);
    } else if(isupper(in[i])){
      in[i] = tolower(in[i]);
    }
  }
  
  printf("%s\n", in);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before 'break'
   17 |       in[j + 1] = '\0'
      |                       ^
      |                       ;
   18 |       break;
      |       ~~~~~
Language: C++

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

main() {

  char ch, hen ;


  while(1){

    cin >> ch;
    
    if(ch == "\n"){
      break;
      
    } else if(islower(ch)) {
      hen = toupper(ch);
      cout << hen;
    }else{
      hen = tolower(ch);
      cout << hen;
    }

    
   

  }

}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(ch == "\n"){
      |        ~~~^~~~~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args){
     Scanner sc= new Scanner(System.in);
    String a= sc.nextLine();
     while(true){
     if(a.equals("0")) 
         break;
     
     
     int sum= 0;
     
     
     for(int= 1;i<a.lenght();i++)
{ 
    sum+= Character.getNumericValue(a.charAt(i))
              
     } 
     
     System.out.println(sum); 
    

   
}}}




Compiler output:
Main.java:15: error: not a statement
     for(int= 1;i<a.lenght();i++)
         ^
Main.java:15: error: ';' expected
     for(int= 1;i<a.lenght();i++)
            ^
Main.java:15: error: not a statement
     for(int= 1;i<a.lenght();i++)
                 ^
Main.java:15: error: ')' expected
     for(int= 1;i<a.lenght();i++)
                            ^
Main.java:15: error: ';' expected
     for(int= 1;i<a.lenght();i++)
                                ^
Main.java:17: error: ';' expected
    sum+= Character.getNumericValue(a.charAt(i))
                                                ^
6 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args){
     Scanner sc= new Scanner(System.in);
    String a= sc.nextLine();
     while(true){
     if(a.equals("0")) 
         break;
     
     
     int sum= 0;
     
     
     for(int a= 0;i<a.lenght();i++)
{ 
    sum+= Character.getNumericValue(a.charAt(i))
              
     } 
     
     System.out.println(sum); 
    

   
}}}




Compiler output:
Main.java:17: error: ';' expected
    sum+= Character.getNumericValue(a.charAt(i))
                                                ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args){
     Scanner sc= new Scanner(System.in);
    String a= sc.nextLine();
     while(true){
     if(a.equals("0")) 
         break;
     
     
     int sum= 0;
     
     
     for(int a= 0;i<a.lenght();i++)
{ 
    sum+= Character.getNumericValue(a.charAt(i));
              
     } 
     
     System.out.println(sum); 
    

   
}}}




Compiler output:
Main.java:15: error: variable a is already defined in method main(String[])
     for(int a= 0;i<a.lenght();i++)
             ^
Main.java:15: error: cannot find symbol
     for(int a= 0;i<a.lenght();i++)
                  ^
  symbol:   variable i
  location: class Main
Main.java:15: error: int cannot be dereferenced
     for(int a= 0;i<a.lenght();i++)
                     ^
Main.java:15: error: cannot find symbol
     for(int a= 0;i<a.lenght();i++)
                               ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
    sum+= Character.getNumericValue(a.charAt(i));
                                             ^
  symbol:   variable i
  location: class Main
Main.java:17: error: int cannot be dereferenced
    sum+= Character.getNumericValue(a.charAt(i));
                                     ^
6 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args){
     Scanner sc= new Scanner(System.in);
    String a= sc.nextLine();
     while(true){
     if(a.equals("0")) 
         break;
     
     
     int sum= 0;
     
     
     for(int i= 0;i<a.lenght();i++)
{ 
    sum+= Character.getNumericValue(a.charAt(i));
              
     } 
     
     System.out.println(sum); 
    

   
}}}




Compiler output:
Main.java:15: error: cannot find symbol
     for(int i= 0;i<a.lenght();i++)
                     ^
  symbol:   method lenght()
  location: variable a of type String
1 error
Language: Java

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

int main() {
    string s;
    while (1){
        cin >> s;
        if (s == "0") break;
        int sum = 0;
        for (char c:s)
            sum += c - '0';
        cout << sum << endl;
    }
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <cstdio>
^
Main.java:2: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#include <cstring>
^
Main.java:9: error: not a statement
        cin >> s;
            ^
Main.java:14: error: not a statement
        cout << sum << endl;
                    ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
6 errors
Language: Java

package javaapplication1;

import java.util.Scanner;
public class sum {
    public static void main(String args[])
    {
        int m,n,sum=0;
        Scanner s=new Scanner(System.in);
        while(true)
        {
            //System.out.print("enter a number:");
           m=s.nextInt();
            if(m==0) break;
            sum=0;
            while(m!=0)
          {
            n=m%10;
            sum+=n;
            m=m/10;
          }
            System.out.println(sum);
        }
        
        }
    }
}



Compiler output:
Main.java:26: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner;

public class Main{ 
        public static void main(String[] args){
            int i=0,count=0,d;
            String a,c;
            int b[];
            b = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a = n.nextLine();
                     if(a=='0'){
                         break;
                     }
                     for(i=0;i<a.length;i++){
                         c = a.charAt(i);
                         d = Integer.parseInt(c);
                         sum = sum + d;
                     }
                     b[i] = sum; 
                     count++;
                     i++;
                }
                while(count>i){
                     System.out.printf("%d",b[i]);
                     i++;
                     System.out.printf("\n");
                }
        }
    }


Compiler output:
Main.java:12: error: bad operand types for binary operator '=='
                     if(a=='0'){
                         ^
  first type:  String
  second type: char
Main.java:15: error: cannot find symbol
                     for(i=0;i<a.length;i++){
                                ^
  symbol:   variable length
  location: variable a of type String
Main.java:16: error: incompatible types: char cannot be converted to String
                         c = a.charAt(i);
                                     ^
Main.java:18: error: cannot find symbol
                         sum = sum + d;
                         ^
  symbol:   variable sum
  location: class Main
Main.java:18: error: cannot find symbol
                         sum = sum + d;
                               ^
  symbol:   variable sum
  location: class Main
Main.java:20: error: cannot find symbol
                     b[i] = sum; 
                            ^
  symbol:   variable sum
  location: class Main
6 errors
Language: Java

import java.util.Scanner;

public class Retugoukei{ 
        public static void main(String[] args){
            int i=0,count=0,d,sum=0,s=0;
            String a;
            char c;
            int b[];
            b = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a = n.nextLine();
                     sum = 0;
                     for(i=0;i<a.length();i++){
                         c = a.charAt(i);
                         d = Character.getNumericValue(c);
                         if(d==0 && (a.length())==0){
                             s=1;
                             break;
                         }
                         sum = sum + d;
                     }
                     if(s==1){
                         System.out.println(b[1]);
                         break;
                     }
                     b[i] = sum; 
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                     System.out.println(b[i]);
                     i++;
                }
        }
    }


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

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


public class CopyOfMain01_08B1 {

	public static void main(String[] args) throws IOException{
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int x=0;

		for(;;){
			x=0;
			String str=br.readLine();
			if(str.equals("0"))break;
			String[] st=str.split("");
			for(int i=0;i<st.length;i++){
				x+=Integer.parseInt(st[i]);
				}
			System.out.println(x);
		}br.close();

		}}

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

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


public class CopyOfMain01_08B1 {

	public static void main(String[] args) throws IOException{
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int x=0;

		while(true){
			x=0;
			String str=br.readLine();
			if(str.equals("0"))break;
			String[] st=str.split("");
			for(int i=0;i<st.length;i++){
				x+=Integer.parseInt(st[i]);
				}
			System.out.println(x);
		}br.close();

		}}

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

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


public class CopyOfMain01_08B1 {

	public static void main(String[] args) throws IOException{
		// 入力導入部
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int x=0;
			String str=br.readLine();
			if(str.equals("0"))break;
			String[] st=str.split("");
			for(int i=0;i<st.length;i++){
				x+=Integer.parseInt(st[i]);
				}
			System.out.println(x);
		}br.close();

		}}

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

import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		while(true)
		{
			long x = stdIn.nextInt();
			long ans = 0;
			
			if(x == 0)
			{
				break;
			}
			
			while(true)
			{
				if(x==0)
				{
					break;
				}
				int k = x % 10;
				x = x/10;
				ans += k;
			}
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:24: error: incompatible types: possible lossy conversion from long to int
				int k = x % 10;
				          ^
1 error
Language: Java


public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			String a = scanner.nextLine();
			if (a.equals("0"))
				break;
			int sum = 0;
			for (String b : a.split("")) {
				sum += Integer.parseInt(b);
			}
			System.out.println(sum);
		}
	}
}

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

import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while(true){
			int sum = 0;
			String str = br.readLine();
				if(str.equals( "0")){
					break;
				}

				for(char c : str.toCharArray()){
					sum += Integer.parseInt("" + c);
				}
			System.out.println(sum);
		}
	}
}
s

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

import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            char [] cs = sc.nextLine();
            if(n == 0) break;
            int s = 0;
            for(int i = 0; i < sc.length; i++) {
                s += cs[i] - '0';
            }
            System.out.println(s);
        }
    }
}

Compiler output:
Main.java:8: error: incompatible types: String cannot be converted to char[]
            char [] cs = sc.nextLine();
                                    ^
Main.java:9: error: cannot find symbol
            if(n == 0) break;
               ^
  symbol:   variable n
  location: class Main
Main.java:11: error: cannot find symbol
            for(int i = 0; i < sc.length; i++) {
                                 ^
  symbol:   variable length
  location: variable sc of type Scanner
3 errors
Language: Java

import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            char [] cs = sc.nextLine().toCharArray();
            if(n == 0) break;
            int s = 0;
            for(int i = 0; i < sc.length; i++) {
                s += cs[i] - '0';
            }
            System.out.println(s);
        }
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
            if(n == 0) break;
               ^
  symbol:   variable n
  location: class Main
Main.java:11: error: cannot find symbol
            for(int i = 0; i < sc.length; i++) {
                                 ^
  symbol:   variable length
  location: variable sc of type Scanner
2 errors
Language: Java

import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            char [] cs = sc.nextLine().toCharArray();
            if(cs[0] == '0') break;
            int s = 0;
            for(int i = 0; i < sc.length; i++) {
                s += cs[i] - '0';
            }
            System.out.println(s);
        }
    }
}

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

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String line = br.readLine();
			int x = Integer.parseInt(line);
			if (x == 0){break;}
			int sum;
			while(x > 0){
				int y = x;
				y = y/10;
				y = y*10;
				sum += (x-y) ;
				x = (y/10);
			}
			System.out.println(sum);
		}
	}
}

Compiler output:
Main.java:17: error: variable sum might not have been initialized
				sum += (x-y) ;
				^
Main.java:20: error: variable sum might not have been initialized
			System.out.println(sum);
			                   ^
2 errors
Language: Java

import java.util.*;
class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		while(true) {
			String s = sc.next();
			if(s == "0") break;
			int ret = 0;
			for(int i = 0; i < s.length(); i++) ret += s[i] - 48;
			System.out.println(ret);
		}
	}
}

Compiler output:
Main.java:9: error: array required, but String found
			for(int i = 0; i < s.length(); i++) ret += s[i] - 48;
			                                            ^
1 error
Language: Java

import java.util.*;

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

		Scanner scan = new Scanner(System.in);
		List<Integer> sums = new ArrayList();
		for(;;){
			String num = scan.nextLine();
			if(num.equals("0")){
				break;
			}
			int sum = 0;
			for(int i = 0; i < num.length(); i++){
				char n = num.charAt(i);
				sum + = Character.getNumericValue(n);
			}
			sums.add(sum);
		}

		for(int m : sums){
			System.out.println(m);
		}
	}
}

Compiler output:
Main.java:16: error: illegal start of expression
				sum + = Character.getNumericValue(n);
				      ^
1 error
Language: Java

import java.util.*;

public class Intro29{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		int sum = 0;
		for(;;){
			int x = scan.nextInt();
			if(x == 0){
				break;
			}
			String number = String.valueOf(x);
			for(int i = 0; i < number.length(); i++){
				char ch = number.charAt(i);
				int n = Integer.parseInt(ch);
				sum += n;
			}
			list.add(sum);
		}

		for(int n : list){
			System.out.println(n);
		}
	}
}

Compiler output:
Main.java:3: error: class Intro29 is public, should be declared in a file named Intro29.java
public class Intro29{
       ^
Main.java:17: error: incompatible types: char cannot be converted to String
				int n = Integer.parseInt(ch);
				                         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		List<Integer> list = new ArrayList<Integer>();
		int sum = 0;
		for(;;){
			int x = scan.nextInt();
			if(x == 0){
				break;
			}
			String number = String.valueOf(x);
			for(int i = 0; i < number.length(); i++){
				char ch = number.charAt(i);
				Srting c = String.valueOf(ch);
				int n = Integer.parseInt(c);
				sum += n;
			}
			list.add(sum);
		}

		for(int n : list){
			System.out.println(n);
		}
	}
}

Compiler output:
Main.java:17: error: cannot find symbol
				Srting c = String.valueOf(ch);
				^
  symbol:   class Srting
  location: class Main
1 error
Language: Java

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//StringBuilder sb = new StringBuilder();

		while(true){

			String input = br.readLine();
			if(input.equals("0")){
				break;
			}

			int total = 0;
			char[] charAry = input.toCharArray();
			for(int i = 0; i < charAry.length; i++){
				total += Character.getNumericValue(charAry[i]);
			}

			System.out.println(total);
		}


	}

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
3 errors
Language: Java

import static java.lang.System.out;
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String num = scan.next();
        String[] numbers = num.split("");
        int ans = 0;
        while (!numbers[0].equals("0")) {
            for (String n : numbers) {
                ans += Integer.parseInt(n);
            }
            out.println(ans);
            num = scan.next();
            numbers = num.split("");
            ans = 0;
    }   
}      

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		String line = null;
		int num = 0;

		Scanner sc = null;
		try {

			sc = new Scanner(System.in);

			do {
				line = sc.nextLine();

					//????????????1?????????????´?
					char[] work = line.toCharArray();

					//??°????????????
					for (int i = 0; i < work.length; i++) {
						num += Character.getNumericValue(work[i]);
					}
					if (num != 0) {

						System.out.println(num);
					}

					//?????????
					num = 0;

			} while (!line.equals("0"));
		} finally {
			sc.close();
		}
	}

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

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

public class Main{
 public static void main(String[] args)throws IOException {
  Scanner scan =new Scanner(System.in);
     
     while(true){
      if(str.equals("0"))break;
         int t=0;
         for(int i=0;i<str.length();i++){
           t+=Character.getNumericValue(str.charAt(i));
         }System.out.println(t);
     }
 }
}

Compiler output:
Main.java:7: error: cannot find symbol
  Scanner scan =new Scanner(System.in);
  ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
  Scanner scan =new Scanner(System.in);
                    ^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
      if(str.equals("0"))break;
         ^
  symbol:   variable str
  location: class Main
Main.java:12: error: cannot find symbol
         for(int i=0;i<str.length();i++){
                       ^
  symbol:   variable str
  location: class Main
Main.java:13: error: cannot find symbol
           t+=Character.getNumericValue(str.charAt(i));
                                        ^
  symbol:   variable str
  location: class Main
5 errors
Language: Java

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

public class Main{
 public static void main(String[] args)throws IOException {
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     
     while(true){
      if(str.equals("0"))break;
         int t=0;
         for(int i=0;i<str.length();i++){
           t+=Character.getNumericValue(str.charAt(i));
         }System.out.println(t);
     }
 }
}

Compiler output:
Main.java:10: error: cannot find symbol
      if(str.equals("0"))break;
         ^
  symbol:   variable str
  location: class Main
Main.java:12: error: cannot find symbol
         for(int i=0;i<str.length();i++){
                       ^
  symbol:   variable str
  location: class Main
Main.java:13: error: cannot find symbol
           t+=Character.getNumericValue(str.charAt(i));
                                        ^
  symbol:   variable str
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		for(;;){
			int x = sc.nextInt();
			int num = 0;
			if(x==0)break;
			for(;;){
				num = num + (x%10);
				x = x / 10;
				if(x==0)break;
			}
			System.out.println(num);
		}
	}	

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

import java.io.*;

public class Main {
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder data = new StringBuilder();
		 
        while(true){
    		int sum = 0;                   //sum??????????????????????????????????¨??????¨???.???????????????????????¨?????????????????????????¨????
            String str = br.readLine();    
            int strsize = str.length();    //strsize?????????????????????????????¨???
                if(str.equals("0")) break;
                
     //??°?????????????????????????????????????????????       
                else if(strsize >= 1) {
                int i = 0;
                while(i < strsize){
                    sum += Integer.parseInt(String.valueOf(str.charAt(i))); //????????§????????????????????¨???????????????????????????
                    i++;
                }
            }
              data.append(sum).append("\n"); //?????£??????????????????????????????????????????????????????????????????????????????????????£??????????????????????????????
        
        } //while?????????
        
     //??????????????????  
        System.out.println(data);

	}

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

import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		
		while(true){
			String s = scanner.nextLine();
			char[] c = s.toCharArray();
			int sum = 0;

			if(s == "0"){
				break;
			}

			for(int i = 0; i < s.length; i++){
				sum += Integer.parseInt(c[i]);
			}

			System.out.println(sum);
		}
	}
}

Compiler output:
Main.java:17: error: cannot find symbol
			for(int i = 0; i < s.length; i++){
			                    ^
  symbol:   variable length
  location: variable s of type String
Main.java:18: error: incompatible types: char cannot be converted to String
				sum += Integer.parseInt(c[i]);
				                         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

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

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(InputStreamReader(System.in));
        String str;
        ArrayList<Integer> Ans = new ArrayList<Integer>();

                    while((str = br.readLine()) != null){
                        String temp[] = str.split("");
                        int sum = 0;
                        for(int i =0;i<temp.length;i++){
                            int num = Integer.parseInt(temp[i]);
                            sum += num;
                        }
                        if(Integer.parseInt(temp[0]) == 0){
                            break;
                        } 
                        Ans.add(sum);
                    }

                    for(int i=0;i<Ans.size();i++){
                        System.out.println(Ans.get(i));
                    }


    }
}

Compiler output:
Main.java:6: error: cannot find symbol
        BufferedReader br = new BufferedReader(InputStreamReader(System.in));
                                               ^
  symbol:   method InputStreamReader(InputStream)
  location: class Main
1 error