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

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

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


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string str;
      |         ^~~~~~
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>str;
      |         ^~~
a.cc:7:14: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |         cin>>str;
      |              ^~~
      |              std
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout<<sum<<endl;
      |         ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |         cout<<sum<<endl;
      |                    ^~~~
Language: C++

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

int main(){
for(;;){
strin num;
cin>>num;
if(num=="0"){break;}
int al={};
for(i=0;i<(int)str.size();i++){
al+=num[i]-'0'
}
cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    6 | strin num;
      | ^~~~~
      | stdin
a.cc:7:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    7 | cin>>num;
      |      ^~~
      |      enum
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<(int)str.size();i++){
      |     ^
a.cc:10:16: error: 'str' was not declared in this scope; did you mean 'std'?
   10 | for(i=0;i<(int)str.size();i++){
      |                ^~~
      |                std
Language: C++

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

int main(){

for(;;){
strin num;
cin>>num;
if(num=="0"){break;}
int al=0;

for(i=0;i<(int)str.size();i++){
al+=num[i]-'0'
}

cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    7 | strin num;
      | ^~~~~
      | stdin
a.cc:8:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 | cin>>num;
      |      ^~~
      |      enum
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<(int)str.size();i++){
      |     ^
a.cc:12:16: error: 'str' was not declared in this scope; did you mean 'std'?
   12 | for(i=0;i<(int)str.size();i++){
      |                ^~~
      |                std
Language: C++

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

int main(){

for(;;){
strin num;
cin>>num;
if(num=="0"){break;}
int al={};

for(i=0;i<(int)str.size();i++){
al+=num[i]-'0';
}

cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    7 | strin num;
      | ^~~~~
      | stdin
a.cc:8:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 | cin>>num;
      |      ^~~
      |      enum
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<(int)str.size();i++){
      |     ^
a.cc:12:16: error: 'str' was not declared in this scope; did you mean 'std'?
   12 | for(i=0;i<(int)str.size();i++){
      |                ^~~
      |                std
Language: C++

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

int main(){

for(;;){
strin num;
cin>>num;
if(num=="0"){break;}
int al={};

for(i=0;i<(int)num.size();i++){
al+=num[i]-'0';
}

cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    7 | strin num;
      | ^~~~~
      | stdin
a.cc:8:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 | cin>>num;
      |      ^~~
      |      enum
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<(int)num.size();i++){
      |     ^
Language: C++

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

int main(){

for(;;){
strin num;
cin>>num;
if(num=="0"){break;}
int al={};

for(int i=0;i<(int)num.size();i++){
al+=num[i]-'0';
}

cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    7 | strin num;
      | ^~~~~
      | stdin
a.cc:8:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 | cin>>num;
      |      ^~~
      |      enum
Language: C++

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

int main(){

for(;;){
strin num;
cin>>num;
if(num=="0"){break;}
int al=0;

for(int i=0;i<(int)num.size();i++){
al+=num[i]-'0';
}

cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    7 | strin num;
      | ^~~~~
      | stdin
a.cc:8:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 | cin>>num;
      |      ^~~
      |      enum
Language: C++

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

int main(){

while(1){
strin num;
cin>>num;
if(num=="0"){break;}
int al={};

for(int i=0;i<(int)num.size();i++){
al+=num[i]-'0';
}

cout<<al<<endl;
}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    7 | strin num;
      | ^~~~~
      | stdin
a.cc:8:6: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 | cin>>num;
      |      ^~~
      |      enum
Language: C++

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |        sum +=str[i]-"0";
Language: C++

#include "iostream"
#include "string"
using namespace std;

int main(int argc, char const *argv[])
{
	char x[1001];
	int y[1001];
	int sum=0;

	while(true)
	{
		cin >> x;
		if(strncmp(x, "0", 1001) == 0)
		{
			break;
		}

		for (int i = 0; i < strlen(x); ++i)
		{
			sum += x[i] -'0';
		}

		cout << sum << endl;

	}

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:20: error: 'strncmp' was not declared in this scope
   14 |                 if(strncmp(x, "0", 1001) == 0)
      |                    ^~~~~~~
a.cc:2:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include "iostream"
  +++ |+#include <cstring>
    2 | #include "string"
a.cc:19:37: error: 'strlen' was not declared in this scope
   19 |                 for (int i = 0; i < strlen(x); ++i)
      |                                     ^~~~~~
a.cc:19:37: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include "iostream"
#include "string"
using namespace std;

int main(int argc, char const *argv[])
{
	char x[1001];
	int y[1001];
	int sum=0;

	while(true)
	{
		sum =0;
		cin >> x;
		if(strncmp(x, "0", 1001) == 0)
		{
			break;
		}

		for (int i = 0; i < strlen(x); ++i)
		{
			sum += x[i] -'0';
		}

		cout << sum << endl;

	}

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:15:20: error: 'strncmp' was not declared in this scope
   15 |                 if(strncmp(x, "0", 1001) == 0)
      |                    ^~~~~~~
a.cc:2:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include "iostream"
  +++ |+#include <cstring>
    2 | #include "string"
a.cc:20:37: error: 'strlen' was not declared in this scope
   20 |                 for (int i = 0; i < strlen(x); ++i)
      |                                     ^~~~~~
a.cc:20:37: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include "iostream"
// #include "string"
using namespace std;

int main(int argc, char const *argv[])
{
	char x[1001];
	int y[1001];
	int sum=0;

	while(true)
	{
		sum =0;
		cin >> x;
		if(strncmp(x, "0", 1001) == 0)
		{
			break;
		}

		for (int i = 0; i < strlen(x); ++i)
		{
			sum += x[i] -'0';
		}

		cout << sum << endl;

	}

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:15:20: error: 'strncmp' was not declared in this scope
   15 |                 if(strncmp(x, "0", 1001) == 0)
      |                    ^~~~~~~
a.cc:2:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include "iostream"
  +++ |+#include <cstring>
    2 | // #include "string"
a.cc:20:37: error: 'strlen' was not declared in this scope
   20 |                 for (int i = 0; i < strlen(x); ++i)
      |                                     ^~~~~~
a.cc:20:37: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include "iostream"
#include "string"
using namespace std;

int main(int argc, char const *argv[])
{
	char x[1001];
	int y[1001];
	int sum=0;

	while(true)
	{
		sum =0;
		cin >> x;
		// if(strncmp(x, "0", 1001) == 0)
		// {
		// 	break;
		// }

		if(x[0] == 48)
		{
			break;
		}

		for (int i = 0; i < strlen(x); ++i)
		{
			sum += x[i] -'0';
		}

		cout << sum << endl;

	}

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:25:37: error: 'strlen' was not declared in this scope
   25 |                 for (int i = 0; i < strlen(x); ++i)
      |                                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include "iostream"
  +++ |+#include <cstring>
    2 | #include "string"
Language: C++

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

int main(){

string str;

while(1){

cin >> str;

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

int sum=0;

for(int i=0;i<(int)str.size();i++){
sum += str[i] - "0";

}

cout << sum << endl;

}

return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   19 | sum += str[i] - "0";
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: expected unqualified-id before 'while'
    5 |     while(1){
      |     ^~~~~
Language: C++

#include <stdio.h>

int main(){
   char number[1001];
   int i, sum;
   while(1){
       scanf(“%s”, number);
       if(number[0]==‘0’)break;
       sum=0;
       for(i=0;number[i]!=‘\0’;i++){
           sum+=number[i]-‘0’;
       }
       printf(“%d\n”, sum);
   }

   return 0;
}


Compiler output:
a.cc:7:14: error: extended character “ is not valid in an identifier
    7 |        scanf(“%s”, number);
      |              ^
a.cc:7:16: error: extended character ” is not valid in an identifier
    7 |        scanf(“%s”, number);
      |                ^
a.cc:8:22: error: extended character ‘ is not valid in an identifier
    8 |        if(number[0]==‘0’)break;
      |                      ^
a.cc:8:22: error: extended character ’ is not valid in an identifier
a.cc:10:27: error: extended character ‘ is not valid in an identifier
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                           ^
a.cc:10:28: error: stray '\' in program
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                            ^
a.cc:10:29: error: extended character ’ is not valid in an identifier
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                             ^
a.cc:11:27: error: extended character ‘ is not valid in an identifier
   11 |            sum+=number[i]-‘0’;
      |                           ^
a.cc:11:27: error: extended character ’ is not valid in an identifier
a.cc:13:15: error: extended character “ is not valid in an identifier
   13 |        printf(“%d\n”, sum);
      |               ^
a.cc:13:18: error: stray '\' in program
   13 |        printf(“%d\n”, sum);
      |                  ^
a.cc:13:19: error: extended character ” is not valid in an identifier
   13 |        printf(“%d\n”, sum);
      |                   ^
a.cc: In function 'int main()':
a.cc:7:14: error: '\U0000201c' was not declared in this scope
    7 |        scanf(“%s”, number);
      |              ^
a.cc:7:16: error: 's\U0000201d' was not declared in this scope
    7 |        scanf(“%s”, number);
      |                ^~
a.cc:8:22: error: '\U000020180\U00002019' was not declared in this scope
    8 |        if(number[0]==‘0’)break;
      |                      ^~~
a.cc:10:27: error: '\U00002018' was not declared in this scope
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                           ^
a.cc:10:28: error: expected ';' before numeric constant
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                            ^~~
      |                            ;
a.cc:10:29: error: unable to find numeric literal operator 'operator""\U00002019'
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                             ^~
a.cc:10:31: error: expected ')' before ';' token
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |           ~                   ^
      |                               )
a.cc:10:35: error: expected ';' before ')' token
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                                   ^
      |                                   ;
a.cc:13:17: error: 'd' was not declared in this scope
   13 |        printf(“%d\n”, sum);
      |                 ^
Language: C++

#include <stdio.h>

int main(){
   char number[1001];
   int i, sum;
   while(1){
       scanf(“%s”, number);
       if(number[0]==48)break;
       sum=0;
       for(i=0;number[i]!=‘\0’;i++){
           sum+=number[I]-48;
       }
       printf(“%d\n”, sum);
   }

   return 0;
}


Compiler output:
a.cc:7:14: error: extended character “ is not valid in an identifier
    7 |        scanf(“%s”, number);
      |              ^
a.cc:7:16: error: extended character ” is not valid in an identifier
    7 |        scanf(“%s”, number);
      |                ^
a.cc:10:27: error: extended character ‘ is not valid in an identifier
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                           ^
a.cc:10:28: error: stray '\' in program
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                            ^
a.cc:10:29: error: extended character ’ is not valid in an identifier
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                             ^
a.cc:13:15: error: extended character “ is not valid in an identifier
   13 |        printf(“%d\n”, sum);
      |               ^
a.cc:13:18: error: stray '\' in program
   13 |        printf(“%d\n”, sum);
      |                  ^
a.cc:13:19: error: extended character ” is not valid in an identifier
   13 |        printf(“%d\n”, sum);
      |                   ^
a.cc: In function 'int main()':
a.cc:7:14: error: '\U0000201c' was not declared in this scope
    7 |        scanf(“%s”, number);
      |              ^
a.cc:7:16: error: 's\U0000201d' was not declared in this scope
    7 |        scanf(“%s”, number);
      |                ^~
a.cc:10:27: error: '\U00002018' was not declared in this scope
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                           ^
a.cc:10:28: error: expected ';' before numeric constant
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                            ^~~
      |                            ;
a.cc:10:29: error: unable to find numeric literal operator 'operator""\U00002019'
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                             ^~
a.cc:10:31: error: expected ')' before ';' token
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |           ~                   ^
      |                               )
a.cc:10:35: error: expected ';' before ')' token
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                                   ^
      |                                   ;
a.cc:13:17: error: 'd' was not declared in this scope
   13 |        printf(“%d\n”, sum);
      |                 ^
Language: C++

#include <stdio.h>

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'I' was not declared in this scope
   11 |             sum+=number[I]-48;
      |                         ^
Language: C++

#include <stdio.h>

int main(){
   char number[1001];
   int i, sum;
   while(1){
       scanf(“%s”, number);
       if(number[0]=='0')break;
       sum=0;
       for(i=0;number[i]!=‘\0’;i++){
           sum+=number[I]-'0';
       }
       printf(“%d\n”, sum);
   }

   return 0;
}


Compiler output:
a.cc:7:14: error: extended character “ is not valid in an identifier
    7 |        scanf(“%s”, number);
      |              ^
a.cc:7:16: error: extended character ” is not valid in an identifier
    7 |        scanf(“%s”, number);
      |                ^
a.cc:10:27: error: extended character ‘ is not valid in an identifier
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                           ^
a.cc:10:28: error: stray '\' in program
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                            ^
a.cc:10:29: error: extended character ’ is not valid in an identifier
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                             ^
a.cc:13:15: error: extended character “ is not valid in an identifier
   13 |        printf(“%d\n”, sum);
      |               ^
a.cc:13:18: error: stray '\' in program
   13 |        printf(“%d\n”, sum);
      |                  ^
a.cc:13:19: error: extended character ” is not valid in an identifier
   13 |        printf(“%d\n”, sum);
      |                   ^
a.cc: In function 'int main()':
a.cc:7:14: error: '\U0000201c' was not declared in this scope
    7 |        scanf(“%s”, number);
      |              ^
a.cc:7:16: error: 's\U0000201d' was not declared in this scope
    7 |        scanf(“%s”, number);
      |                ^~
a.cc:10:27: error: '\U00002018' was not declared in this scope
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                           ^
a.cc:10:28: error: expected ';' before numeric constant
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                            ^~~
      |                            ;
a.cc:10:29: error: unable to find numeric literal operator 'operator""\U00002019'
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                             ^~
a.cc:10:31: error: expected ')' before ';' token
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |           ~                   ^
      |                               )
a.cc:10:35: error: expected ';' before ')' token
   10 |        for(i=0;number[i]!=‘\0’;i++){
      |                                   ^
      |                                   ;
a.cc:13:17: error: 'd' was not declared in this scope
   13 |        printf(“%d\n”, sum);
      |                 ^
Language: C++

123434134414
999999999999999999
234823492348923949234
1134842394
12349
219349
2394295922
2134324009823984932973957384823684234729917374928374
89237497289349179374923947926525620343
8412634873268747123
2987489327983
1000000000000000000000001
0


Compiler output:
a.cc:3:1: warning: integer constant is too large for its type
    3 | 234823492348923949234
      | ^~~~~~~~~~~~~~~~~~~~~
a.cc:8:1: warning: integer constant is too large for its type
    8 | 2134324009823984932973957384823684234729917374928374
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:1: warning: integer constant is too large for its type
    9 | 89237497289349179374923947926525620343
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:1: warning: integer constant is too large for its type
   12 | 1000000000000000000000001
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 123434134414
      | ^~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
string str;
getline(cin,str);
for(int i=0;i<(int)str.size();i++){
if('a'<=str[i]&&str[i]<='z'){
str[i]=str[i]-'a'+'A';
}else if('A'<=str[i]&&str[i]<='Z'){
str[i]=str[i]-'A'+'a';
}

cout<<str<<endl;
return 0;
}


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

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

while(){
int x,y=0;
cin>>x;
if(x=0)break;

 while(x>0){
  y += x%10;
  x /= 10
 }

}

}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected primary-expression before ')' token
    5 | while(){
      |       ^
a.cc:12:10: error: expected ';' before '}' token
   12 |   x /= 10
      |          ^
      |          ;
   13 |  }
      |  ~
Language: C++

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

while(){
int x,y=0;
cin>>x;
if(x=0)break;

 while(x>0){
  y += x%10;
  x /= 10;
 }

}

}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected primary-expression before ')' token
    5 | while(){
      |       ^
Language: C++

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

while(1){
int x,y=0;
cin>>x;
if(x=0)break;

 while(){
  y += x%10;
  x /= 10;
if(x=0)break;
 }

}

}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected primary-expression before ')' token
   10 |  while(){
      |        ^
Language: C++

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

while(1){
int x,y=0;
cin>>x;
if(x=0)break;

 while(){
  y += x%10;
  x /= 10;
 if(x=0)break;
 }

}

}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected primary-expression before ')' token
   10 |  while(){
      |        ^
Language: C++

#include <iostream>
#include <string> 
using namespace std;
 int main(){
 string n;
 while(1){
 cin >> n; 
if (n == "0") break;
 int a=0,b=0,i;
 for(i=0 ;i < n.length(); ++i){
 a=number[i];
 b=b+a;
 } 
cout << b << endl;
 }
 return 0;
 } 

  

 



 

 



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

#include <iostream>
#include <string> 
using namespace std;
 int main(){
 string n;
 while(1){
 cin >> n; 
if (n == "0") break;
 int a=0,b=0,i;
 for(i=0 ;i < n.length(); ++i){
 a=number[i]-'0';
 b=b+a;
 } 
cout << b << endl;
 }
 return 0;
 } 

  

 



 

 



Compiler output:
a.cc: In function 'int main()':
a.cc:11:4: error: 'number' was not declared in this scope
   11 |  a=number[i]-'0';
      |    ^~~~~~
Language: C++

#include <iostream>
#include <string> 
using namespace std;
 int main(){
 string n;
 while(1){
 cin >> n; 
if (n == "0") break;
 int a=0,b=0,i;
 for(i=0 ;i < n.length(); ++i){
 a=n[i]-"0";
 b=b+a;
 } 
cout << b << endl;
 }
 return 0;
 } 

  

 



 

 



Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   11 |  a=n[i]-"0";
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  while(1){
    string str;
    cin>>str;
    if(str=="0"){
      break;
    }
    int sum=0;
    for(int i=0;i<(int)str.size();i++){
      sum+=str[i]-'0':
    }
    cout<<sum<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before ':' token
   12 |       sum+=str[i]-'0':
      |                      ^
      |                      ;
Language: C++

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


int main(){

	while(1){
		string str;
		cin >>str;
		if(str =="0") break;
		else{
			int sum =0;
			for(int i;i<(int)str.size();i++){
				sum += str[i] -'0';
			}

		}
		cout << sum <<"\n";
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: 'sum' was not declared in this scope
   21 |                 cout << sum <<"\n";
      |                         ^~~
Language: C++

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


int main(){

	while(1){
		string str;
		cin >>str;
		if(str =="0") break;
		else{
			int sum =0;
			for(int i =0;i<(int)str.size();i++){
				sum += str[i] -'0';
			}

		}
		cout << sum <<"\n";
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: 'sum' was not declared in this scope
   21 |                 cout << sum <<"\n";
      |                         ^~~
Language: C++

#include<bits/stdc"".h>
using namespace std=
int main(){
    while(1){
        string str;
        cin>>str;
        if(str=="0"){
            break;
        }
        int sum=0;
        for(int i=0;i<(int)str.size();i++){
            sum+=str[i]-'0';
        }
        cout<<sum<<endl;
    }
    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(){
    while(1){
        string str;
        cin>>str;
        if(str=="0"){
            break;
        }
        int sum=0;
        for(int i=0;i<(int)str.size();i++){
            sum+=str[i]-'0';
        }
        cout<<sum<<endl;
    }
    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(){
    while(1){
        string str;
        cin>>str;
        if(str=="0"){
            break;
        }
        int sum=0;
        for(int i=0;i<(int)str.size();i++){
            sum+=str[i]-'0';
        }
        cout<<sum<<endl;
    }
    return 0;
}


Compiler output:
a.cc:2:20: error: expected ';' before '=' token
    2 | using namespace std=
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before '=' token
Language: C++

#include<bits/stdc++.h> using namespace std; int main(){ while(1){ string str; cin>>str; if(str=="0"){ break; } int sum=0; for(int i=0;i<(int)str.size();i++){ sum+=str[i]-'0'; } cout<<sum<<endl; } return 0; } 


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h> using namespace std; int main(){ while(1){ string str; cin>>str; if(str=="0"){ break; } int sum=0; for(int i=0;i<(int)str.size();i++){ sum+=str[i]-'0'; } cout<<sum<<endl; } return 0; }
      |                         ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:39: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |                         sum += num[i] - "0";
Language: C++

int main(){
  char str[1001];

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'scanf' was not declared in this scope
    5 |     scanf("%s", str);
      |     ^~~~~
a.cc:8:20: error: 'strlen' was not declared in this scope
    8 |     for(int i=0; i<strlen(str); i++){
      |                    ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int main(){
a.cc:11:5: error: 'printf' was not declared in this scope
   11 |     printf("%d\n", sum);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
Language: C++

#include<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> using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { for (;;) { string s; cin >> s; if (s == "0") break; int n = s.size(); int sum = 0; for (int i = 0; i < n; i++) sum += s[i] - '0'; printf("%d\n", sum); } return 0; } 






Compiler output:
a.cc:1:18: warning: extra tokens at end of #include directive
    1 | #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> using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { for (;;) { string s; cin >> s; if (s == "0") break; int n = s.size(); int sum = 0; for (int i = 0; i < n; i++) sum += s[i] - '0'; printf("%d\n", sum); } return 0; }
      |                  ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <ctype.h>
#include <math.h>
#include <algorithm>

using namespace std;

int main () {
    char x[1001];

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

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

        int sum = 0;
        for (int i = 0; i < strlen(x); i++) {
            sum += (x[i] - '0');
        }

        cout << sum << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:29: error: 'strlen' was not declared in this scope
   19 |         for (int i = 0; i < strlen(x); i++) {
      |                             ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <algorithm>
  +++ |+#include <cstring>
    7 |
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(){
    int ans[50000];
    int count;
    while(1){
        string number;
        cin >> number;
        int one_sum = 0;
        for(int i =0; i < number.size(); i++){
            int a = number[i] - "0";
            one_sum += a;
        }
        ans[count] = one_sum;
        count +=1;
        if (one_sum == 0){
            break;
        }
    }
    int word = 0;

    while (word < count-1){
        cout << ans[word] << '\n';
        word +=1;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:31: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   30 |             int a = number[i] - "0";
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(){
    int ans[50000];
    int count;
    while(1){
        char number;
        scanf("%s", number);
        int one_sum = 0;
        for(int i =0; i < number.size(); i++){
            int a = number[i] - '0';
            one_sum += a;
        }
        ans[count] = one_sum;
        count +=1;
        if (one_sum == 0){
            break;
        }
    }
    int word = 0;

    while (word < count-1){
        cout << ans[word] << '\n';
        word +=1;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:34: error: request for member 'size' in 'number', which is of non-class type 'char'
   29 |         for(int i =0; i < number.size(); i++){
      |                                  ^~~~
a.cc:30:27: error: invalid types 'char[int]' for array subscript
   30 |             int a = number[i] - '0';
      |                           ^
Language: C++

#include <stdio.h>

int main(void)
{
int i,sum[26];
char ABC;
scanf("%c",&ABC);
while(ABC != EOF)

/*EOF(ファイル終了[End Of File])でないかどうか確認*/

{
if (isalpha(ABC) != 0)

/*入力されたものがアルファベットかどうか確認*/

{
sum[(tolower(ABC) -'a')] += 1;

/*入力されたアルファベットを小文字に変換&0~25の数値に変換*/

}
scanf("%c",&ABC);
}
for(i = 0;i <= 25;i++)
{
printf("%c : %d\n",'a' + i,sum[i]);
}
return 0;
}




}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'isalpha' was not declared in this scope
   13 | if (isalpha(ABC) != 0)
      |     ^~~~~~~
a.cc:18:6: error: 'tolower' was not declared in this scope
   18 | sum[(tolower(ABC) -'a')] += 1;
      |      ^~~~~~~
a.cc: At global scope:
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

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

int main(){
	
	while(1){
		
		string kazu;
		int sum=0;
		cin>>kazu;
		
		if(kazu == 0) break;
		
		for(int i=0;i<(int)kazu.size();i++){
			
			sum += kazu;
			
			cout<<sum<<endl;
		}
		sum=0;
	}
	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 <iostream>
using namespace std;

int itp08_b() {

	string x;
	while (cin >> x, x.compare("0")) {
		cout << x.length() << endl;
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>

using namespace std;

int main(){
string number;

while(1){
cin >> number;
if (number == "0") break;
int a=0,b=0,i=0;
while(2){

a=number(i) - '0'
if (a<0 || a>9)break;
b=b+a
i=i+1
}
cout << b << endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   14 | a=number(i) - '0'
      |   ~~~~~~^~~
a.cc:16:6: error: expected ';' before 'i'
   16 | b=b+a
      |      ^
      |      ;
   17 | i=i+1
      | ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
string number;

while(1){
cin >> number;
if (number == "0") break;
int a=0,b=0,i=0;
while(2){

a=number(i) - '0'
if (a<0 || a>9)break;
b=b+a
i=i+1
}
cout << b << endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   15 | a=number(i) - '0'
      |   ~~~~~~^~~
a.cc:17:6: error: expected ';' before 'i'
   17 | b=b+a
      |      ^
      |      ;
   18 | i=i+1
      | ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
string number;

while(1){
cin >> number;
if (number == "0") break;
int a=0,b=0,i=0;
while(true){

a=number[i] - '0'
if (a<0 || a>9) break;
b=b+a
i=i+1
}
cout << b << endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before 'if'
   15 | a=number[i] - '0'
      |                  ^
      |                  ;
   16 | if (a<0 || a>9) break;
      | ~~                
a.cc:17:6: error: expected ';' before 'i'
   17 | b=b+a
      |      ^
      |      ;
   18 | i=i+1
      | ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
string number;

while(1){
cin >> number;
if (number == "0") break;
int a=0,b=0,i=0;
while(true){

a=number[i] - '0'
if (a<0 || a>9) break;
b=b+a
i=i+1
}
cout << b << endl;
}
cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before 'if'
   15 | a=number[i] - '0'
      |                  ^
      |                  ;
   16 | if (a<0 || a>9) break;
      | ~~                
a.cc:17:6: error: expected ';' before 'i'
   17 | b=b+a
      |      ^
      |      ;
   18 | i=i+1
      | ~
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[] = {0};
        String alphabet[] = {"abcdefghijklmnopqrstuvwxyz"};
        while(true)
        {
            String str = sc.next();
            if(str.equals("."))
                break;
            str = str.toLowerCase;
            for(int i = 0 ; i < str.length() ; i++)
                if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
                    alphabet[str.charAt(i) - 'a']++;
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(alphabet[i] + " : " + result[i]);
    }
}


Compiler output:
Main.java:12: error: cannot find symbol
            str = str.toLowerCase;
                     ^
  symbol:   variable toLowerCase
  location: variable str of type String
Main.java:15: error: bad operand type String for unary operator '++'
                    alphabet[str.charAt(i) - 'a']++;
                                                 ^
2 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[] = {0};
        String alphabet[] = {"abcdefghijklmnopqrstuvwxyz"};
        while(true)
        {
            String str = sc.next();
            if(str.equals("."))
                break;
            str = str.toLowerCase;
            for(int i = 0 ; i < str.length() ; i++)
                if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
                    result[str.charAt(i) - 'a']++;
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(alphabet[i] + " : " + result[i]);
    }
}


Compiler output:
Main.java:12: error: cannot find symbol
            str = str.toLowerCase;
                     ^
  symbol:   variable toLowerCase
  location: variable str of type String
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[] = {0};
        String alphabet[] = {"abcdefghijklmnopqrstuvwxyz"};
        while(sc.hasNext)
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)
                if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
                    result[str.charAt(i) - 'a']++;
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(alphabet[i] + " : " + result[i]);
    }
}


Compiler output:
Main.java:7: error: cannot find symbol
        while(sc.hasNext)
                ^
  symbol:   variable hasNext
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[] = {0};
        String alphabet[] = {"abcdefghijklmnopqrstuvwxyz"};
        while(sc.hasNext())
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)]
            {
                if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
                    result[str.charAt(i) - 'a']++;
            }
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(alphabet[i] + " : " + result[i]);
    }
}


Compiler output:
Main.java:11: error: illegal start of expression
            for(int i = 0 ; i < str.length() ; i++)]
                                                   ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[] = new int[26];
        Arrays.fill(result,0);
        String alphabet[] = {"abcdefghijklmnopqrstuvwxyz"};
        while(sc.hasNext())
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)
            {
                if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z')
                    result[str.charAt(i) - 'a']++;
            }
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(alphabet[i] + " : " + result[i]);
    }
}


Compiler output:
Main.java:6: error: cannot find symbol
        Arrays.fill(result,0);
        ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args) 	{
		Scanner sc = new Scanner(System.in);
		int alphabet[];
		alphabet = new int[26];
		for(int i = 0;i < 26; i++) {
			alphabet[i] = 0;
		}
		while(0 < 1) {
			String str = sc.next();
			str = str.toLowerCase();
			for(int i = 0;i < str.length();i++) {
				if(97 <= str.charAt(i) && str.charAt(i) <= 122) alphabet[str.charAt(i) - 97]++;
			}
			if(str == NULL) break;
		}
		for(int i = 0;i < 26;i++) {
			System.out.printf("%c : %d\n",i + 97,alphabet[i]);
		}
		sc.close();
	}
}


Compiler output:
Main.java:17: error: cannot find symbol
			if(str == NULL) break;
			          ^
  symbol:   variable NULL
  location: class Main
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext())
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)
            {
                char c = str.charAt(i);
                if(c >= 'a' && c <= 'z')
                    result[c - 'a']++;
            }
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(alphabet[i] + " : " + result[i]);
    }
}


Compiler output:
Main.java:13: error: cannot find symbol
                    result[c - 'a']++;
                    ^
  symbol:   variable result
  location: class Main
Main.java:17: error: cannot find symbol
            System.out.println(alphabet[i] + " : " + result[i]);
                               ^
  symbol:   variable alphabet
  location: class Main
Main.java:17: error: cannot find symbol
            System.out.println(alphabet[i] + " : " + result[i]);
                                                     ^
  symbol:   variable result
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[26];
        for(int i = 0 ; i < 26 ; i++)
            result[i] = 0;
        while(sc.hasNext())
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)
            {
                char c = str.charAt(i);
                if(c >= 'a' && c <= 'z')
                    result[c - 'a']++;
            }
        }
        for(int i = 0 ; i < 26 ; i++)
            System.out.println(('a' + i)　+ " : " + result[i]);
    }
}


Compiler output:
Main.java:5: error: ']' expected
        int result[26];
                   ^
Main.java:20: error: illegal character: '\u3000'
            System.out.println(('a' + i)?+ " : " + result[i]);
                                        ^
Main.java:20: error: not a statement
            System.out.println(('a' + i)?+ " : " + result[i]);
                                                         ^
Main.java:20: error: ';' expected
            System.out.println(('a' + i)?+ " : " + result[i]);
                                                            ^
4 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[26];
        for(int i = 0 ; i < 26 ; i++)
            result[i] = 0;
        while(sc.hasNext())
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)
            {
                char c = str.charAt(i);
                if(c >= 'a' && c <= 'z')
                    result[c - 'a']++;
            }
        }
        for(int i = 0 ; i < 26 ; i++)
        {
            char c = 'a' + i;
            System.out.println(c　+ " : " + result[i]);
        }
    }
}


Compiler output:
Main.java:5: error: ']' expected
        int result[26];
                   ^
Main.java:22: error: illegal character: '\u3000'
            System.out.println(c?+ " : " + result[i]);
                                ^
Main.java:22: error: not a statement
            System.out.println(c?+ " : " + result[i]);
                                                 ^
Main.java:22: error: ';' expected
            System.out.println(c?+ " : " + result[i]);
                                                    ^
4 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int result[26];
        for(int i = 0 ; i < 26 ; i++)
            result[i] = 0;
        while(sc.hasNext())
        {
            String str = sc.next();
            str = str.toLowerCase();
            for(int i = 0 ; i < str.length() ; i++)
            {
                char c = str.charAt(i);
                if(c >= 'a' && c <= 'z')
                    result[c - 'a']++;
            }
        }
        for(int i = 0 ; i < 26 ; i++)
        {
            char ch = 'a' + i;
            System.out.println(c　+ " : " + result[i]);
        }
    }
}


Compiler output:
Main.java:5: error: ']' expected
        int result[26];
                   ^
Main.java:22: error: illegal character: '\u3000'
            System.out.println(c?+ " : " + result[i]);
                                ^
Main.java:22: error: not a statement
            System.out.println(c?+ " : " + result[i]);
                                                 ^
Main.java:22: error: ';' expected
            System.out.println(c?+ " : " + result[i]);
                                                    ^
4 errors