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

#include <iostream> #include <string> using namespace std; int ans;
string s;
int main(){
    cin >> s;
    if(s[0]=='1') ans++;
    if(s[1]=='1') ans++;
    if(s[2]=='1') ans++;
    cout << ans << endl;
}

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <string> using namespace std; int ans;
      |                     ^
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin >> s;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:12: error: 's' was not declared in this scope
    4 |     cin >> s;
      |            ^
a.cc:5:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    5 |     if(s[0]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:6:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    6 |     if(s[1]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:7:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     if(s[2]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     cout << ans << 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:8:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     cout << ans << endl;
      |             ^~~
      |             abs
a.cc:8:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |     cout << ans << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  string s;
  cin >> s;
  int cnt = 0;
  if (s[0] == "1") ++cnt;
  if (s[1] == "1") ++cnt;
  if (s[2] == "1") ++cnt;
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if (s[0] == "1") ++cnt;
a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if (s[1] == "1") ++cnt;
a.cc:13:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   if (s[2] == "1") ++cnt;
Language: C++

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

int main(){
  int S1,S2,S3,S;
  cin >> S;
  S1=S%10,S2=(S%100-s1)/10,S3=(S%1000-10*S2-S1)/100;
  cout<< S1+S2+S3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 's1' was not declared in this scope; did you mean 'S1'?
    7 |   S1=S%10,S2=(S%100-s1)/10,S3=(S%1000-10*S2-S1)/100;
      |                     ^~
      |                     S1
Language: C

#include<stdio.h>
 
int main(void)
{
  int i, n;
  int oddflag = 0;
  int count = 0;
  int a[200];
  
  scanf("%d\n", &n);
  for (i=0; i<n; i++)
    scanf("%d", &a[i]);
  
  while(1){
    for(i=0; i<n; i++){
      if(a[i]%2 != 0)
        oddflag = 1;
      
   if(oddflag == 0) break;
    
   for(i=0; i<n; i++)
     a[i]/=2;
   count++;
   };
    
  printf("%d", count);
  return 0;
 }

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

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

int main(){
string a;
  cin>> a;
  int ans;
 for(int i=0;i<3;i++){
   if(a[i]=="1"){ans++;}
 }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |    if(a[i]=="1"){ans++;}
Language: C++

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

int main(){
string a[3],
  int ans;
 for(int i=0;i<3;i++){
 cin >> a[i];
   if(a[i]=="1"){ans++;}
 }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected unqualified-id before 'int'
    6 |   int ans;
      |   ^~~
a.cc:9:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |    if(a[i]=="1"){ans++;}
      |                  ^~~
      |                  abs
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <set>

using namespace std;
using ll = long long ;

int main() {
  string s;
  cin >> s;
  if(s[0]=='1') ans++;
  if(s[1]=='1') ans++;
  if(s[2]=='1') ans++;
  cout << ans << endl;
return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   if(s[0]=='1') ans++;
      |                 ^~~
      |                 abs
a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   if(s[1]=='1') ans++;
      |                 ^~~
      |                 abs
a.cc:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |   if(s[2]=='1') ans++;
      |                 ^~~
      |                 abs
a.cc:16:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  
  int ans = 0;
  for(int i =0; i < (int)s.size; ++i){
    ans += (int)s[i];
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |   for(int i =0; i < (int)s.size; ++i){
      |                          ~~^~~~
      |                                ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  
  int ans = 0;
  for(int i =0; i < (int)s.size; ++i){
    ans += (int)s[i];
  }
  
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |   for(int i =0; i < (int)s.size; ++i){
      |                          ~~^~~~
      |                                ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  
  int ans = 0;
  for(int i =0; i < (int)str.size; ++i){
    ans += (int)str[i];
  }
  
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: 'str' was not declared in this scope; did you mean 'std'?
    9 |   for(int i =0; i < (int)str.size; ++i){
      |                          ^~~
      |                          std
Language: C++

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

int main() {
  string s;
  int sum = 0;
  cin >> s;
  
  for(int i=0; i < s.size(); i++){
    if(s.at(i) == "1")
      sum++;
  }
  
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s.at(i) == "1")
      |        ~~~~~~~~^~~~~~
Language: C

#include <stdio.h>
 
int main ()
{
  char s;
  int ans;
  
  scanf("%s", &s);
  
  if(s[0]=='1')
    ans++;
  if(s[1]=='1')
    ans++;
  if(s[2]=='1')
    ans++;
    
  printf("%d", ans);
  
  return 0 ;
  
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: subscripted value is neither array nor pointer nor vector
   10 |   if(s[0]=='1')
      |       ^
main.c:12:7: error: subscripted value is neither array nor pointer nor vector
   12 |   if(s[1]=='1')
      |       ^
main.c:14:7: error: subscripted value is neither array nor pointer nor vector
   14 |   if(s[2]=='1')
      |       ^
Language: C

#include <stdio.h>
 
int main ()
{
  char s;
  int ans;
  
  scanf("%s", &s);
  
  if(s[0]==1)
    ans++;
  if(s[1]==1)
    ans++;
  if(s[2]==1)
    ans++;
    
  printf("%d", ans);
  
  return 0 ;
  
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: subscripted value is neither array nor pointer nor vector
   10 |   if(s[0]==1)
      |       ^
main.c:12:7: error: subscripted value is neither array nor pointer nor vector
   12 |   if(s[1]==1)
      |       ^
main.c:14:7: error: subscripted value is neither array nor pointer nor vector
   14 |   if(s[2]==1)
      |       ^
Language: C++

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

int main() {
  int=a,b;
  cin >> a;
  b = a%10;
  a = a/10;
  b = b+a%10;
  a = a/10;
  cout << a+b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: expected unqualified-id before '=' token
    5 |   int=a,b;
      |      ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a;
      |          ^
a.cc:7:3: error: 'b' was not declared in this scope
    7 |   b = a%10;
      |   ^
Language: C++

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

int main() {
  int ans = 0;
  string s;
  
  cin >> s;
  for (int i = 0; i < 3; i++) {
    if (s[i] = 1) {
      ans++;
    }
  }
  
  cout << ans << endl;
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected '}' at end of input
   15 |   cout << ans << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int S1,S2,S3;
  cin >>S1S2S3;
  cout <<(S1+S2+S3);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'S1S2S3' was not declared in this scope
    6 |   cin >>S1S2S3;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,d
  cin >> a;
  b=a/100;
  c=((a%100)-(a%10))/10;
  d=a%10;
  cout <<b+c+d<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> a;
      |   ^~~
a.cc:9:3: error: 'd' was not declared in this scope
    9 |   d=a%10;
      |   ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int S = N % 10 + (N / 10) % 10 + (N / 100) % 10;
  cout << S << endl;
}

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:3: error: 'cin' was not declared in this scope
    6 |   cin >> N;
      |   ^~~
a.cc:9:3: error: 'cout' was not declared in this scope
    9 |   cout << S << endl;
      |   ^~~~
a.cc:9:16: error: 'endl' was not declared in this scope
    9 |   cout << S << endl;
      |                ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int S = N % 10 + (N / 10) % 10 + (N / 100) % 10;
  cout << S << endl;

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:3: error: 'cin' was not declared in this scope
    6 |   cin >> N;
      |   ^~~
a.cc:9:3: error: 'cout' was not declared in this scope
    9 |   cout << S << endl;
      |   ^~~~
a.cc:9:16: error: 'endl' was not declared in this scope
    9 |   cout << S << endl;
      |                ^~~~
a.cc:9:21: error: expected '}' at end of input
    9 |   cout << S << endl;
      |                     ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

// ABC081A - 

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

typedef unsigned long long int ull;
typedef long long int ll;

int main() {
	string S;
	cin >> S;

	int ans = 0;

	for (int i = 0; i < 3; i++) {
		if (s[i] == '1') {
			++ans;
		}
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 's' was not declared in this scope
   16 |                 if (s[i] == '1') {
      |                     ^
Language: C++

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

int main() {
  vector<int> = A(3);
  for (int i = 0; i < A.size(); i++) {
    cin << A.at(i);
  }
  
  int sum = 0;
  for (int i = 0; i < A.size(); i++) {
    if (A.at(i) = 1) {
      s += 1;
    }
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: expected unqualified-id before '=' token
    5 |   vector<int> = A(3);
      |               ^
a.cc:6:23: error: 'A' was not declared in this scope
    6 |   for (int i = 0; i < A.size(); i++) {
      |                       ^
a.cc:11:23: error: 'A' was not declared in this scope
   11 |   for (int i = 0; i < A.size(); i++) {
      |                       ^
a.cc:13:7: error: 's' was not declared in this scope
   13 |       s += 1;
      |       ^
Language: C++

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

int main(){
  char s[2];
  cin >> s;
  int a=0;
  for (int i=0; i<3; i++ )
  {
     if (s[i]='1')
	{
          a++;
         }
  }
  out << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'out' was not declared in this scope
   15 |   out << a << endl;
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin >> a;
  cout << a/100 + (a%100)/10 + a%10
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:36: error: expected ';' before '}' token
    7 |   cout << a/100 + (a%100)/10 + a%10
      |                                    ^
      |                                    ;
    8 | }
      | ~
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String ss[] = new String[3];
		sc.close();

		int count = 0;
		for(int i = 0; i < ss.length; i++) {
			ss[i] = str.substring(i , i + 1);
			if(ss[i].equals("1")) {
				count++;
			}else {
				continue;
			}
		}

		System.out.println(count);
	}
}

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

class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int a1=num/100;
		if(a1==1)
			num-=100;
		int a2=num/10;
		if(a2==1)
			num-=10;
		int a3=num/1;

		int sum=a1+a2+a3;
		System.out.println(sum);

		sc.close();
	}

}


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

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  int x;
  cin >> x;
  int a = x / 100;
  int b = (x - (a * 100)) / 10;
  int c = ((x - (a * 100)) / 10) / 1;
  
  int A = a + b + c
   
  cout << A << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected ',' or ';' before 'cout'
   14 |   cout << A << endl;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  int x;
  cin >> x;
  int a = x / 100;
  int b = (x - (a * 100)) / 10;
  int c = ((x - (a * 100)) / 10) / 1
  
  int A = a + b + c
   
  cout << A << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'int'
   12 |   int A = a + b + c
      |   ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int a, b, c, d;
  cin >> a ;
  
  b = a/100
  c = (a-b)/10
  d = (a-b-c)
    
  cout << b+c+d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'c'
    8 |   b = a/100
      |            ^
      |            ;
    9 |   c = (a-b)/10
      |   ~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int a, s1, s2, s3;
  cin >> a;
  
  s3 = a/1
  s2 = a/10
  s1 = a/100
    
  cout << s1+s2+s3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before 's2'
    8 |   s3 = a/1
      |           ^
      |           ;
    9 |   s2 = a/10
      |   ~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int a, s1, s2, s3;
  cin >> a ;
  
  s3 = a%1
  s2 = (a/10)%1
  s1 = (a/100)%1
    
  cout << s1+s2+s3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before 's2'
    8 |   s3 = a%1
      |           ^
      |           ;
    9 |   s2 = (a/10)%1
      |   ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int a,b,c;
  cin >> a >> b >> c;
  
  cout << (a + b + c) % 4r << endl;
}

Compiler output:
a.cc:9:3: warning: large fixed-point constant implicitly truncated to fixed-point type [-Woverflow]
    9 |   cout << (a + b + c) % 4r << endl;
      |   ^~~~
a.cc: In function 'int main()':
a.cc:9:25: error: fixed-point types not supported in C++
    9 |   cout << (a + b + c) % 4r << endl;
      |                         ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {

 string s;
  cin >> s
    cout << s[0] + s[1] + s[2] << endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected ';' before 'cout'
    7 |   cin >> s
      |           ^
      |           ;
    8 |     cout << s[0] + s[1] + s[2] << endl;
      |     ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {

 string s;
  cin >> s
    cout << s[1] + s[2] + s[3] << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected ';' before 'cout'
    7 |   cin >> s
      |           ^
      |           ;
    8 |     cout << s[1] + s[2] + s[3] << endl;
      |     ~~~~
Language: C++

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

int main() {
  
  int fuckyou;
  
  cin fuckyou;
  
  cout << fuckyou % 9 << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected ';' before 'fuckyou'
    8 |   cin fuckyou;
      |      ^~~~~~~~
      |      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {

  int s[1], s[2], s[3];
  cin >> s[1] >> s[2] >> s[3];
  cout << s[1] + s[2] + s[3] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: conflicting declaration 'int s [2]'
    6 |   int s[1], s[2], s[3];
      |             ^
a.cc:6:7: note: previous declaration as 'int s [1]'
    6 |   int s[1], s[2], s[3];
      |       ^
a.cc:6:19: error: conflicting declaration 'int s [3]'
    6 |   int s[1], s[2], s[3];
      |                   ^
a.cc:6:7: note: previous declaration as 'int s [1]'
    6 |   int s[1], s[2], s[3];
      |       ^
Language: C++

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

int main() {
  
  int a,b,c;
  
  cin a >> b >> c;
  
  cout << a + b + c << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected ';' before 'a'
    8 |   cin a >> b >> c;
      |      ^~
      |      ;
Language: C++

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

int main() {
  int s1,s2,s3;
  cin >> s1s2s3;
  cout << s1+s2+s3 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 's1s2s3' was not declared in this scope
    6 |   cin >> s1s2s3;
      |          ^~~~~~
Language: Java

import java.util.Scanner;

public class Main2 {
	public static void main(String[] args){
		
	Scanner scan = new Scanner(System.in);
	String str = scan.next();
	
	String[] strArray = str.split("");
	
	int count = 0;
	
	for(int i = 0; i < strArray.length ; i++ ) {
	if(strArray[i].equals("1")) {
		count++;
	  }
	 }
	System.out.println(count);
	}
}

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

public class Main2 {
	public static void main(String[] args){
		
	Scanner scan = new Scanner(System.in);
	String str = scan.next();
	
	// splitで分割して格納
	String[] strArray = str.split("");
	
	int count = 0;
	
	for(int i = 0; i < strArray.length ; i++ ) {
	if(strArray[i].equals("1")) {
		count++;
	  }
	 }
	System.out.println(count);
	}
}

Compiler output:
Main.java:1: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
Main.java:4: error: cannot find symbol
	Scanner scan = new Scanner(System.in);
	^
  symbol:   class Scanner
  location: class Main2
Main.java:4: error: cannot find symbol
	Scanner scan = new Scanner(System.in);
	                   ^
  symbol:   class Scanner
  location: class Main2
3 errors
Language: Java

public class Main2 {
	public static void main(String[] args){
	int[] numbers = new int[3];
	numbers[0] = 1;
	numbers[1] = 0;
	numbers[2] = 0;
	
	int count = 0;
	
	for(int i = 0; i <= 2 ; i++ ) {
	if(numbers[i] == 1) {
		count++;
	  }
	 }
	System.out.println(count);
	}
}


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

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    string ss;
    cin >> ss;

    int ct = 0;
    // 出力
    for(stirng ss : s)
    {
        if(s == "1")
        {
            ct++;
        }
    }
    cout << ct;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'stirng' was not declared in this scope
   11 |     for(stirng ss : s)
      |         ^~~~~~
a.cc:20:5: error: expected primary-expression before 'return'
   20 |     return 0;
      |     ^~~~~~
a.cc:18:16: error: expected ')' before 'return'
   18 |     cout << ct;
      |                ^
      |                )
   19 | 
   20 |     return 0;
      |     ~~~~~~      
a.cc:11:8: note: to match this '('
   11 |     for(stirng ss : s)
      |        ^
Language: C++

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

int main() {
  // ここにプログラムを追記
  string s;
  cin >> s;
  int n[3];
  for(int i=0;i<3;i++){
    if(s[i]=='1') n[i]=1; else n[i]=0;
  }
  cout << n[0]+n[1]+n[2] << endl;
  return 0;
}
    #include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      cout << /* ここに式を書く */ << endl;
    }

Compiler output:
a.cc:18:9: error: redefinition of 'int main()'
   18 |     int main() {
      |         ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:19:36: error: expected primary-expression before '<<' token
   19 |       cout << /* ここに式を書く */ << endl;
      |                                    ^~
Language: C++

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

int main() {
  // ここにプログラムを追記
  string s;
  cin >> s;
  int n[3];
  for(int i=0;i<3;i++){
    if(s[i]=='1') n[i]=1 else n[i]=0;
  }
  cout << n[0]+n[1]+n[2] << endl;
  return 0;
}
    #include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      cout << /* ここに式を書く */ << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected ';' before 'else'
   10 |     if(s[i]=='1') n[i]=1 else n[i]=0;
      |                         ^~~~~
      |                         ;
a.cc: At global scope:
a.cc:18:9: error: redefinition of 'int main()'
   18 |     int main() {
      |         ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:19:36: error: expected primary-expression before '<<' token
   19 |       cout << /* ここに式を書く */ << endl;
      |                                    ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
  vector<int>nyu(3);
  cin >> nyu.at(0) >> nyu.at(1) >> nyu.at(2);
  int count=0;
  for(int i=0;i<3;i++){
    if(nyu.at(i)=='1'){
      count++;
    }
  }
  
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int>nyu(3);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int>nyu(3);
      |          ^~~
a.cc:5:10: error: 'nyu' was not declared in this scope
    5 |   cin >> nyu.at(0) >> nyu.at(1) >> nyu.at(2);
      |          ^~~
Language: Java


public class Main {
	public static void main(String[] args) {
		//宣言文
		//標準入力オブジェクトを生成
		Scanner sc = new Scanner(System.in);
		//標準入力で以下の変数を初期化
		String[] numArray = new String[3];
		numArray[0] = sc.next();
		numArray[1] = sc.next();
		numArray[2] = sc.next();
		//フラグ変数
		int countNum = 0;
		//処理文
			if(numArray[0].equals("1")){
				//1をカウントする。
				countNum++;
			}
			if(numArray[1].equals("1")) {
				countNum++;
			}
			if(numArray[2].equals("1")) {
				countNum++;
			}

			//標準出力
			System.out.print(countNum);
	}
}

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

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

int main(){

int string s;  cin >> s;

int count;

if (s.at(0) == 1) count++;
if (s.at(1) == 1) count++;
if (s.at(2) == 1) count++;

cout << count << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected initializer before 's'
    6 | int string s;  cin >> s;
      |            ^
a.cc:6:23: error: 's' was not declared in this scope
    6 | int string s;  cin >> s;
      |                       ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
	string s;
	cin >> s;
	int asn = 0;
	rep(i, 3) if(s[i]=='1') ans++;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:33: error: 'ans' was not declared in this scope; did you mean 'asn'?
   11 |         rep(i, 3) if(s[i]=='1') ans++;
      |                                 ^~~
      |                                 asn
a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'asn'?
   12 |         cout << ans << endl;
      |                 ^~~
      |                 asn
Language: C++

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

int main() {
  int a,b,c,d;
  
  cin >> a;
  
  b=a/100;
  c=(a-b*100)/10;
  d=(a-b*100-c*10)
  cout << b+c+d << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before 'cout'
   11 |   d=(a-b*100-c*10)
      |                   ^
      |                   ;
   12 |   cout << b+c+d << endl;
      |   ~~~~
Language: C++

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

int main(){
  int i;
  int a = 0;
  bool S[3] = {0};
    
    for (i=0; i<3; i++){
      cin >> S[i];
    }
    
  	for (i=0; i<3; i++){
      a = a + S[i];
    }
  printf(%d\n,a);
}


Compiler output:
a.cc:17:12: error: stray '\' in program
   17 |   printf(%d\n,a);
      |            ^
a.cc: In function 'int main()':
a.cc:17:10: error: expected primary-expression before '%' token
   17 |   printf(%d\n,a);
      |          ^
a.cc:17:11: error: 'd' was not declared in this scope
   17 |   printf(%d\n,a);
      |           ^
Language: C++

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

int main(){
  int i;
  int a = 0;
  int S = [3]
    
    for (i=0; i<3; i++){
      cin >> S[i];
    }
    
  	for (i=0; i<3; i++){
      a = a + S[i];
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected identifier before numeric constant
    7 |   int S = [3]
      |            ^
a.cc: In lambda function:
a.cc:9:5: error: expected '{' before 'for'
    9 |     for (i=0; i<3; i++){
      |     ^~~
a.cc: In function 'int main()':
a.cc:7:11: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
    7 |   int S = [3]
      |           ^~~
a.cc:7:11: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
    7 |   int S = [3]
      |           ^
a.cc:7:11: note:   no known conversion from 'void (*)()' to 'int'
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for (i=0; i<3; i++){
      |     ^~~
a.cc:9:23: error: expected ';' before ')' token
    9 |     for (i=0; i<3; i++){
      |                       ^
      |                       ;
a.cc:14:16: error: invalid types 'int[int]' for array subscript
   14 |       a = a + S[i];
      |                ^
Language: C++

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

int main(){
  int i;
  int a = 0;
  bool S = [3]
    
    for (i=0; i<3; i++){
      cin >> S[i];
    }
    
  	for (i=0; i<3; i++){
      a = a + S[i];
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected identifier before numeric constant
    7 |   bool S = [3]
      |             ^
a.cc: In lambda function:
a.cc:9:5: error: expected '{' before 'for'
    9 |     for (i=0; i<3; i++){
      |     ^~~
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
a.cc:9:23: error: expected ';' before ')' token
    9 |     for (i=0; i<3; i++){
      |                       ^
      |                       ;
a.cc:14:16: error: invalid types 'bool[int]' for array subscript
   14 |       a = a + S[i];
      |                ^
Language: C++

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

int main(){
  string a;
  getline(cin,a );
  int s;
  for(int i=0;i<3;i++){
    if(a[i]==1){
       s+=1
    }
   
  }
  cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before '}' token
   11 |        s+=1
      |            ^
      |            ;
   12 |     }
      |     ~
Language: C++

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

int main() {
  char* in_data;
  char* p;
  int count;
  
  cin >> in_data;
  
  for(p = in_data; p != '\0'; p++) {
    if(p == '1') {
      count++;
    }
  }
  cout << count << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   for(p = in_data; p != '\0'; p++) {
      |                    ~~^~~~~~~
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if(p == '1') {
      |        ~~^~~~~~
Language: C++

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

int main() {
  char* in_data;
  int count;
  
  cin >> in_data;
  
  for(int i; i < in_data.length(); i++) {
    if(in_data[i] == '1') {
      count++;
    }
  }
  cout << count++ << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: request for member 'length' in 'in_data', which is of non-class type 'char*'
   10 |   for(int i; i < in_data.length(); i++) {
      |                          ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int s1 ,s2 ,s3;
  cin >> s1 >> s2 >> s3;
  cout << s1+s2+s3 << else;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before 'else'
    7 |   cout << s1+s2+s3 << else;
      |                       ^~~~
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in) {
        String s = String(sc.nextInt());
        
        int count =0;
        
        for (char c: s.toCharArray()){
          if (c == "1") {
            count ++;
          }
		}
        return count;
	}
}

Compiler output:
Main.java:9: error: illegal start of type
        for (char c: s.toCharArray()){
        ^
Main.java:9: error: ';' expected
        for (char c: s.toCharArray()){
                   ^
Main.java:9: error: <identifier> expected
        for (char c: s.toCharArray()){
                                  ^
Main.java:9: error: ';' expected
        for (char c: s.toCharArray()){
                                    ^
Main.java:14: error: illegal start of type
        return count;
        ^
Main.java:14: error: <identifier> expected
        return count;
                    ^
Main.java:15: error: ';' expected
	}
	 ^
Main.java:16: error: reached end of file while parsing
}
 ^
8 errors
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    int x = 0;
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();
    for(int i=0;i<s.length();i++){
      if(s.substring(i,i+1) == '1'){
        x++;
      }
    }
    System.out.println(x);
  }
}


Compiler output:
Main.java:10: error: bad operand types for binary operator '=='
      if(s.substring(i,i+1) == '1'){
                            ^
  first type:  String
  second type: char
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    int x = 0;
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();
    for(int i=0;i<s.length();i++){
      if(s.charAt(i).toString() == "1"){
        x++;
      }
    }
    System.out.println(x);
  }
}


Compiler output:
Main.java:10: error: char cannot be dereferenced
      if(s.charAt(i).toString() == "1"){
                    ^
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    int x = 0;
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();
    for(int i=0;i<s.length();i++){
      if(s.charAt(i) == "1"){
        x++;
      }
    }
    System.out.println(x);
  }
}


Compiler output:
Main.java:10: error: bad operand types for binary operator '=='
      if(s.charAt(i) == "1"){
                     ^
  first type:  char
  second type: String
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    int x = 0;
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();
    for(int i=0;i<3;i++){
      if(s.charAt(i) == "1"){
        x++;
      }
    }
    System.out.println(x);
  }
}


Compiler output:
Main.java:10: error: bad operand types for binary operator '=='
      if(s.charAt(i) == "1"){
                     ^
  first type:  char
  second type: String
1 error
Language: C++

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

int main() {
  
  int s;
  cin >> s;
  int sum;
  
  for(int i = 0;i < 3;i++){
     
    if(s == 1){
    sum++;
    }
    else if(s == 0){
      continue
   }
    }
  cout << sum << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: expected ';' before '}' token
   16 |       continue
      |               ^
      |               ;
   17 |    }
      |    ~
Language: C++

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

int main() {
  
  int s;
  cin >> s;
  int sum;
  
  for(int i = 0;i < 3;i++){
     
    if(s == 1){
    sum++ 
    }
    else if(s == 0){
   }
    }
  cout << sum << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: expected ';' before '}' token
   13 |     sum++
      |          ^
      |          ;
   14 |     }
      |     ~
Language: C++

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

int main() {
  
  int s;
  cin >> s;
  int sum;
  
  for(int i = 0,i < 3,i++;){
     
    if(s == 1){
      cout << sum++ << endl;
    }
    else if(s == 0){
      cout << sum++ << endl;
   }
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before '<' token
   10 |   for(int i = 0,i < 3,i++;){
      |                  ^~
      |                  ;
a.cc:10:19: error: expected primary-expression before '<' token
   10 |   for(int i = 0,i < 3,i++;){
      |                   ^
Language: C++

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

int main() {
  
  int s;
  cin >> s;
  int sum;
  
  for(int i = 0,i < 2,i++;){
     
    if(s == 1){
      cout << sum++ << endl;
    }
    else if(s == 0){
      cout << sum++ << endl;
   }
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before '<' token
   10 |   for(int i = 0,i < 2,i++;){
      |                  ^~
      |                  ;
a.cc:10:19: error: expected primary-expression before '<' token
   10 |   for(int i = 0,i < 2,i++;){
      |                   ^
Language: C++

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

int main() {
  
  int s;
  cin >> s;
  int sum;
  
  for(int i = 0,i < 2,i++){
     
    if(s == 1){
      cout << sum++ << endl;
    }
    else if(s == 0){
      cout << sum++ << endl;
   }
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before '<' token
   10 |   for(int i = 0,i < 2,i++){
      |                  ^~
      |                  ;
a.cc:10:19: error: expected primary-expression before '<' token
   10 |   for(int i = 0,i < 2,i++){
      |                   ^
a.cc:10:26: error: expected ';' before ')' token
   10 |   for(int i = 0,i < 2,i++){
      |                          ^
      |                          ;
Language: C++

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

int main() {
  
  int s;
  cin >> s;
  int sum;
  
  for(i = 0,i < 2,i++){
     
    if(s == 1){
      cout << sum++ << endl;
    }
    else if(s == 0){
      cout << sum++ << endl;
   }
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i = 0,i < 2,i++){
      |       ^
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:6: error: expected ';' before '}' token
   18 |     }
      |      ^
      |      ;
   19 |   }
      |   ~   
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:6: error: expected ')' before '}' token
   18 |     }
      |      ^
      |      )
   19 |   }
      |   ~   
a.cc:10:6: note: to match this '('
   10 |   for(i = 0,i < 2,i++){
      |      ^
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
Language: C++

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

int ans = 0;
string s;

int main() {
 
  cin >> s;
  if(s[0]=="1") ans++;
  if(s[1]=="1") ans++;
  if(s[2]=="1") ans++;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if(s[0]=="1") ans++;
a.cc:11:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[1]=="1") ans++;
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if(s[2]=="1") ans++;
Language: C++

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

int main() {
  int ABC;
  cin >> A >> B >>C;
  cout << A+B+C << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'A' was not declared in this scope
    6 |   cin >> A >> B >>C;
      |          ^
a.cc:6:15: error: 'B' was not declared in this scope
    6 |   cin >> A >> B >>C;
      |               ^
a.cc:6:19: error: 'C' was not declared in this scope
    6 |   cin >> A >> B >>C;
      |                   ^
Language: C++

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

int main() {
  int s1s2s3;
  cin >> s1 >> s2 >> s3;
  cout << (s1+2)/3 + (s2+2)/3 + (s3+2)/3 <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 's1' was not declared in this scope; did you mean 'y1'?
    6 |   cin >> s1 >> s2 >> s3;
      |          ^~
      |          y1
a.cc:6:16: error: 's2' was not declared in this scope
    6 |   cin >> s1 >> s2 >> s3;
      |                ^~
a.cc:6:22: error: 's3' was not declared in this scope
    6 |   cin >> s1 >> s2 >> s3;
      |                      ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
  cin>>s;

  int counter=0;
  if(counter.at(0) == "1"){
  counter++;
  }
 if(counter.at(1) == "1"){
  counter++;
  }
  if(counter.at(2) == "1"){
  counter++;
  }
  
  cout<<counter;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: request for member 'at' in 'counter', which is of non-class type 'int'
    8 |   if(counter.at(0) == "1"){
      |              ^~
a.cc:11:13: error: request for member 'at' in 'counter', which is of non-class type 'int'
   11 |  if(counter.at(1) == "1"){
      |             ^~
a.cc:14:14: error: request for member 'at' in 'counter', which is of non-class type 'int'
   14 |   if(counter.at(2) == "1"){
      |              ^~
Language: C++

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

  string s;
  cin >> s;
  int count=0;
  if (s[0] == '1') ++count;
  if (s[1] == '1') ++count;
  if (s[2] == '1') ++count;
  cout << count << endl;
  
  
  
return 0;
}

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:6:10: error: expected primary-expression before 's'
    6 |   string s;
      |          ^
a.cc:6:10: error: expected '}' before 's'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin >> s;
      |   ^~~
a.cc:9:3: error: expected unqualified-id before 'if'
    9 |   if (s[0] == '1') ++count;
      |   ^~
a.cc:10:3: error: expected unqualified-id before 'if'
   10 |   if (s[1] == '1') ++count;
      |   ^~
a.cc:11:3: error: expected unqualified-id before 'if'
   11 |   if (s[2] == '1') ++count;
      |   ^~
a.cc:12:3: error: 'cout' does not name a type
   12 |   cout << count << endl;
      |   ^~~~
a.cc:16:1: error: expected unqualified-id before 'return'
   16 | return 0;
      | ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

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

int main() {
  // ここにプログラムを追記
      string x;
      cin >> x;

      int s=0;
      for (int i=0; i<3 ; i++){
        if (x.at(i) == "1"){
          s++;}
        else {s +=0;
      }
      }
      cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (x.at(i) == "1"){
      |             ~~~~~~~~^~~~~~
Language: C++

using namespace std;
int ans;
string s;
int main(){　
   
  
  cin >> s ;
  if(s[0]==1 )   { ans++;
                 }
  if(s[1]==1)    { ans++;
                 }
  if(s[2]==1 )	  { ans++;
                  }
   cout << ans << endl ;
}
                     


Compiler output:
a.cc:4:12: error: extended character 　 is not valid in an identifier
    4 | int main(){　
      |            ^
a.cc:3:1: error: 'string' does not name a type
    3 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:4:12: error: '\U00003000' was not declared in this scope
    4 | int main(){　
      |            ^~
a.cc:8:6: error: 's' was not declared in this scope
    8 |   if(s[0]==1 )   { ans++;
      |      ^
a.cc:10:6: error: 's' was not declared in this scope
   10 |   if(s[1]==1)    { ans++;
      |      ^
a.cc:12:6: error: 's' was not declared in this scope
   12 |   if(s[2]==1 )    { ans++;
      |      ^
a.cc:14:4: error: 'cout' was not declared in this scope
   14 |    cout << ans << endl ;
      |    ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:14:19: error: 'endl' was not declared in this scope
   14 |    cout << ans << endl ;
      |                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

using namespace std;
int ans;
string s;
int main(){　
   
 int ans; 
  string s ;
  
  cin >> s ;
  if(s[0]==1 )   { ans++;
                 }
  if(s[1]==1)    { ans++;
                 }
  if(s[2]==1 )	  { ans++;
                  }
   cout << ans << endl ;
}
                     

Compiler output:
a.cc:4:12: error: extended character 　 is not valid in an identifier
    4 | int main(){　
      |            ^
a.cc:3:1: error: 'string' does not name a type
    3 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:4:12: error: '\U00003000' was not declared in this scope
    4 | int main(){　
      |            ^~
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s ;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> s ;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:9:10: error: 's' was not declared in this scope
    9 |   cin >> s ;
      |          ^
a.cc:16:4: error: 'cout' was not declared in this scope
   16 |    cout << ans << endl ;
      |    ^~~~
a.cc:16:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:19: error: 'endl' was not declared in this scope
   16 |    cout << ans << endl ;
      |                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main() {
	
  string A = { a , b , c };
  
  int sum = 0 ;
  for( i=0 ; i < A.size() ; i++ ){
    if( A.at(i)== '1'){
      sum++ ;
    }
  }
  
  cout << sum << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'a' was not declared in this scope
    6 |   string A = { a , b , c };
      |                ^
a.cc:6:20: error: 'b' was not declared in this scope
    6 |   string A = { a , b , c };
      |                    ^
a.cc:6:24: error: 'c' was not declared in this scope
    6 |   string A = { a , b , c };
      |                        ^
a.cc:6:26: error: could not convert '{<expression error>, <expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    6 |   string A = { a , b , c };
      |                          ^
      |                          |
      |                          <brace-enclosed initializer list>
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for( i=0 ; i < A.size() ; i++ ){
      |        ^
Language: C++

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

int main() {
  // ここにプログラムを追記
  string x;
  cin >> x;
 
  int s=0;
  for (int i=0; i<3 ; i++){
    if (x.at(i) = 1){
      s++;}
    else {s +=0;
  }
  cout << s << endl;
}


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

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

int main() {
  // ここにプログラムを追記
  string x;
  cin >> x;
 
  int s=0;
  for (int i=0; i<3 ; i++){
    if (x.(i) = 1){
      s++;}
  }
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected unqualified-id before '(' token
   11 |     if (x.(i) = 1){
      |           ^