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

#include<stdio.h>
int main (){
  int ans ,S = 0;
  scanf("%d",S);
  for(int i = 0 ;i<6;i++){
    if (S %10 =1){
      ans += 1;
    }
    S /= 10;
  }
  printf("%d\n",ans);
  return 0 ;
}  


Compiler output:
main.c: In function 'main':
main.c:6:15: error: lvalue required as left operand of assignment
    6 |     if (S %10 =1){
      |               ^
Language: C

#include<stdio.h>
int main (){
  int ans,S = 0;
  scanf("%d",S);
  for(int i = 0 ;i<6;i++){
    if (S % 10 = 1){
      ans += 1;
    }
    S /= 10
  }
  printf("%d\n",ans);
  return 0 ;
}  


Compiler output:
main.c: In function 'main':
main.c:6:16: error: lvalue required as left operand of assignment
    6 |     if (S % 10 = 1){
      |                ^
main.c:9:12: error: expected ';' before '}' token
    9 |     S /= 10
      |            ^
      |            ;
   10 |   }
      |   ~
Language: C

#include<stdio.h>
int main (){
  int ans = 0;
  char S[7];
  scanf("%6s",S);
  for(int i = 0 ;i<6;i++){
    if (S[i]='1'){
      ans += 1;
    }
  }
  print("%d\n",ans);
  return 0 ;
}  

Compiler output:
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 |   print("%d\n",ans);
      |   ^~~~~
      |   printf
Language: C++

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

const int MOD = 1000000007;
const int INF = 1000000000;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){
string S;
cin >> S;
int cnt = 0;
REP(i, S.length()) if(s[i] == '1') cnt++;
print(cnt);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:23: error: 's' was not declared in this scope
   47 | REP(i, S.length()) if(s[i] == '1') cnt++;
      |                       ^
Language: C++

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

int main(){
  vector <string> S;
  for (int i=0; i<6; i++){
    cin >> S.at(i);
  }
  int count = 0;
  for (int i=0; i<6; i++){
      if (S.at(i) = '1'){
          count ++;
      }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: could not convert '(& S.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)i)))->std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |       if (S.at(i) = '1'){
      |           ~~~~~~~~^~~~~
      |                   |
      |                   std::__cxx11::basic_string<char>
Language: C++

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

int main(){
 stirng s;
  cin >> s;
  int ans =0;
  for(int i=0;i<6;i++){
    if(s.at(i) == '1') ans++;
  }
  cout << ans << endl;
  
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 0;
  for(int = 0; i < 6; i++)
    if(s[i] == '1') ans++;
  cout << ans << endl;  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected unqualified-id before '=' token
    9 |   for(int = 0; i < 6; i++)
      |           ^
a.cc:9:10: error: expected ';' before '=' token
    9 |   for(int = 0; i < 6; i++)
      |          ^~
      |          ;
a.cc:9:11: error: expected primary-expression before '=' token
    9 |   for(int = 0; i < 6; i++)
      |           ^
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int = 0; i < 6; i++)
      |                ^
a.cc:9:21: error: expected ')' before ';' token
    9 |   for(int = 0; i < 6; i++)
      |      ~              ^
      |                     )
a.cc:9:23: error: 'i' was not declared in this scope
    9 |   for(int = 0; i < 6; i++)
      |                       ^
Language: C++

#include<iostream>
using namespace std;
#include<string>
#include<algorithm>
using ll=long long;
const ll AMAX = 100000;


ll main() {
	ll N, K;
	ll a[AMAX], b[AMAX];
	cin >> N >> K;
	for (int i = 0; 0 < N; i++) {
		cin >> a[i] >> b[i];
		for (int j = 0; j < b[i];j++) {

			a[i + j] = a[i];
			i++;
		}
	}
	sort(a, a + K);

	cout << a[K];



}

Compiler output:
a.cc:9:1: error: '::main' must return 'int'
    9 | ll main() {
      | ^~
Language: C++

#include<stdio.h>
int main() 
{
	int a = 0;
	string s;

	cin >> s;
    for(int i=0;i<7;i++)if(s[i]=='1')a++;
	
	cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope; did you mean 'stdin'?
    5 |         string s;
      |         ^~~~~~
      |         stdin
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> s;
      |         ^~~
a.cc:7:16: error: 's' was not declared in this scope
    7 |         cin >> s;
      |                ^
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout << a;
      |         ^~~~
Language: C++


int main() 
{
	int a = 0;
	string s;

	cin >> s;
    for(int i=0;i<7;i++)if(s[i]=='1')a++;
	
	cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> s;
      |         ^~~
a.cc:7:16: error: 's' was not declared in this scope
    7 |         cin >> s;
      |                ^
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout << a;
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  char a[10],c="1";
  int b=0;
  cin>>a;
  for(int i=;i<10;i++)
    if(a[i]==c)
      b++;
  cout<<b<<endl;
  return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:16: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    4 |   char a[10],c="1";
      |                ^~~
      |                |
      |                const char*
a.cc:7:13: error: expected primary-expression before ';' token
    7 |   for(int i=;i<10;i++)
      |             ^
Language: C++

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()){
    return vector2<T>(n0, vector<T>(n1, e));
}

template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()){
    return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    string s;
    cin >> s;
    int ans = 0;
    rep(i, n) ans += s[i] - '0';
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:12: error: 'n' was not declared in this scope
   50 |     rep(i, n) ans += s[i] - '0';
      |            ^
a.cc:17:39: note: in definition of macro 'rep'
   17 | #define rep(i, n) for(int i = 0; i < (n); ++i)
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  char s;
  for (int i = 0; i < 6; i++){
    cin >> s;
    N+=stoi(s);
  }
  cout << N;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: no matching function for call to 'stoi(char&)'
    8 |     N+=stoi(s);
      |        ~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'char' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'char' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main (){

string s;
int r=0;

cin >> s;

for(int i=0;i<s.size();i++){
if(s[i] =='1')r++
}

cout << r <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expected ';' before '}' token
   12 | if(s[i] =='1')r++
      |                  ^
      |                  ;
   13 | }
      | ~
Language: C++

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

int main (){

string s;
int r=0;

cin >> s;

for(i=0;i<s.size();i++){
if(s[i] =='1')r++
}

cout << r <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'i' was not declared in this scope
   11 | for(i=0;i<s.size();i++){
      |     ^
a.cc:12:18: error: expected ';' before '}' token
   12 | if(s[i] =='1')r++
      |                  ^
      |                  ;
   13 | }
      | ~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <math.h>

int main() {
  string s;
  cin >> s;
  int ans = 0;
  int n = s.size();
  for(int i=0;i<n;i++){
    if(s.at(i) == '1'){
      ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> s;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   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:16:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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>
using namespace std;

int main() {
  
  vector<char> data(6);
  for (int i = 0; i < 6; i++) {
    cin >> data.at(i);
  }

  
  int answer = 0;

  for (int i = 0; i < 6; i++) {

    if (data.at(i) == "1") {
      answer++;
    }

  }

  cout << answer << endl;
}


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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  int ans=0;
  string S;
  cin>>S;
  
  for(int i=0; i<6; ++i) if(S.at(i)=='1') ans+;;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:47: error: expected primary-expression before ';' token
   23 |   for(int i=0; i<6; ++i) if(S.at(i)=='1') ans+;;
      |                                               ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <math.h>
#include <string>
using namespace std;
typedef long long int ll;

int main(){
	string s; cin >> s;
	int cnt=0;
	for(int i=0;i<6;i++){
		if(s[i]=='1')cnt++;
	}
	cout << cnt << emdl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'emdl' was not declared in this scope
   16 |         cout << cnt << emdl;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  string a,; int ans=0;
  cin>>a;
    rep(i,6) if(a[i]=='1') ans++;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: expected unqualified-id before ';' token
    5 |   string a,; int ans=0;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> a(2, 0);
  for (int i = 0; i < 6; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  cout << x[1];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'x' was not declared in this scope
   10 |   cout << x[1];
      |           ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'a' was not declared in this scope
    9 |     if(a[i]=='1') ans++;
      |        ^
Language: C++

#i n cl u d e <s t d i o . h>
i n t main ( )
{
ch a r s [ 1 0 ] ;
s c a n f (”% s ” , s ) ;
i n t r = 0 ;
f o r ( i n t i = 0 ; i < 6 ; i++)r += s [ i ] − ’ 0 ’ ;
p r i n t f (”%d\n ” , r ) ;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #i; did you mean #if?
    1 | #i n cl u d e <s t d i o . h>
      |  ^
      |  if
a.cc:5:12: error: extended character ” is not valid in an identifier
    5 | s c a n f (”% s ” , s ) ;
      |            ^
a.cc:5:17: error: extended character ” is not valid in an identifier
    5 | s c a n f (”% s ” , s ) ;
      |                 ^
a.cc:7:48: error: extended character − is not valid in an identifier
    7 | f o r ( i n t i = 0 ; i < 6 ; i++)r += s [ i ] − ’ 0 ’ ;
      |                                                ^
a.cc:7:50: error: extended character ’ is not valid in an identifier
    7 | f o r ( i n t i = 0 ; i < 6 ; i++)r += s [ i ] − ’ 0 ’ ;
      |                                                  ^
a.cc:7:54: error: extended character ’ is not valid in an identifier
    7 | f o r ( i n t i = 0 ; i < 6 ; i++)r += s [ i ] − ’ 0 ’ ;
      |                                                      ^
a.cc:8:14: error: extended character ” is not valid in an identifier
    8 | p r i n t f (”%d\n ” , r ) ;
      |              ^
a.cc:8:17: error: stray '\' in program
    8 | p r i n t f (”%d\n ” , r ) ;
      |                 ^
a.cc:8:20: error: extended character ” is not valid in an identifier
    8 | p r i n t f (”%d\n ” , r ) ;
      |                    ^
a.cc:2:1: error: 'i' does not name a type
    2 | i n t main ( )
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    string S; cin >> S;
    int ans = count(S.begin(),S.end(),'1');
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'count' was not declared in this scope
    6 |     int ans = count(S.begin(),S.end(),'1');
      |               ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s,cin>>s;
    int count=0;
    for(int i=0;i<6;i++){
        if(s[i]=='1')count++;
    }
    cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: expected initializer before '>>' token
    4 |     string s,cin>>s;
      |                 ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long INF = 1LL << 60;
template <class T> bool chmin(T& a, T b){if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b){if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}

int main()
{
  string S;
  cin >> S;
  int N = S.size();
  
  int ans = 0;
  
  for (int i = 0; i < N; i++)
  {
    if (S.at(i) == '1' ans++;
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: expected ';' before 'ans'
   22 |     if (S.at(i) == '1' ans++;
      |                       ^~~~
      |                       ;
a.cc:23:3: error: expected primary-expression before '}' token
   23 |   }
      |   ^
a.cc:22:30: error: expected ')' before '}' token
   22 |     if (S.at(i) == '1' ans++;
      |        ~                     ^
      |                              )
   23 |   }
      |   ~                           
a.cc:23:3: error: expected primary-expression before '}' token
   23 |   }
      |   ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
	
  string s;
  int a,b,c,d,i,j,k;
  
  cin >> s;
  int a=0;
  for(i=0;i<6;i++){
	if(s[i]=='1')a++;
  } 
  cout << a<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: redeclaration of 'int a'
   15 |   int a=0;
      |       ^
a.cc:12:7: note: 'int a' previously declared here
   12 |   int a,b,c,d,i,j,k;
      |       ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    8 |     if(stoi(s[i]) == 1) ans ++;
      |        ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: request for member 'size' in 's', which is of non-class type 'int'
    7 |   for(int i = 0; i < s.size(); i++) {
      |                        ^~~~
a.cc:8:9: error: invalid types 'int[int]' for array subscript
    8 |     if(s[i] == 1) ans ++;
      |         ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:24: error: expected ';' before '}' token
    6 |   if(s[0]=='1'){count++}
      |                        ^
      |                        ;
main.c:7:24: error: expected ';' before '}' token
    7 |   if(s[1]=='1'){count++}
      |                        ^
      |                        ;
main.c:8:24: error: expected ';' before '}' token
    8 |   if(s[2]=='1'){count++}
      |                        ^
      |                        ;
main.c:9:24: error: expected ';' before '}' token
    9 |   if(s[3]=='1'){count++}
      |                        ^
      |                        ;
main.c:10:24: error: expected ';' before '}' token
   10 |   if(s[4]=='1'){count++}
      |                        ^
      |                        ;
main.c:11:24: error: expected ';' before '}' token
   11 |   if(s[5]=='1'){count++}
      |                        ^
      |                        ;
Language: C++

#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	string s;
	cin >> s;
	cout << s.count('1') << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   15 |         cout << s.count('1') << endl;
      |                   ^~~~~
Language: C++

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

int main() {
  int answer = 0 ;
  
  for (int i = 0 ; i < 6 ; i++) {
    char a ;
    cin >> a ;
    answer += a - '0' +
  }
  
  cout << answer << endl ;
}

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

#include<bits/stdc++.h>
int main() { 
  char s [10]; 
  cin >> s ; 
  int r = 0; 
  for ( int i = 0; i < 6; i++) {
    r += s [ i ] − ’0’; 
  }
  cout << r << endl ;
}

Compiler output:
a.cc:7:18: error: extended character − is not valid in an identifier
    7 |     r += s [ i ] − ’0’;
      |                  ^
a.cc:7:20: error: extended character ’ is not valid in an identifier
    7 |     r += s [ i ] − ’0’;
      |                    ^
a.cc:7:20: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> s ;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:7:17: error: expected ';' before '\U00002212'
    7 |     r += s [ i ] − ’0’;
      |                 ^~
      |                 ;
a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout << r << 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:9:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout << r << endl ;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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>
using namespace std ;

int main () {
  int a ;
  cin >> a ;
  
  int answer = 0 ;
  
  for (int i = 0 ; i < 6 ; i++ ) {
    answer += a[i]
  }
  
  cout << answer << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: invalid types 'int[int]' for array subscript
   11 |     answer += a[i]
      |                ^
Language: C++

#include<bits/stdc++.h>
  2 
  3 using namespace std;
  4 
  5 int main()
  6 {
  7     string str;
  8     int kount = 0; 
  9     
 10     getline(cin, str);
 11     
 12     for(int i = 0; i < str.size(); i++){
 13         if(str[i] == '1') kount++;
 14     }
 15     
 16     cout << kount << "\n"; 
 17 
 18     
 19     return 0;
 20 }


Compiler output:
a.cc:2:3: error: expected unqualified-id before numeric constant
    2 |   2
      |   ^
a.cc:4:3: error: expected unqualified-id before numeric constant
    4 |   4
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int main(){
	string s;
	int len,i,sum=0;
	cin>>s;
	len=s.size();
	for(i=0;i<len;i++){
		if(s[i]=="1"){
			sum++;
		}
	}
	cout<<sum;
	return 0;
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: conflicting declaration 'int s'
    6 |   int s=0;
      |       ^
a.cc:5:10: note: previous declaration as 'std::string s'
    5 |   string s;cin>>s;
      |          ^
a.cc:8:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    8 |     if(s[i]=='1')s++;
      |                  ~^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: conflicting declaration 'int s'
    5 |   int s=0;
      |       ^
a.cc:4:10: note: previous declaration as 'std::string s'
    4 |   string s;cin>>s;
      |          ^
a.cc:7:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    7 |     if(s[i]=='1')s++;
      |                  ~^~
Language: C++

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

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

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

#include<bits/stdc++.h>
using namespace std;
long long n;
string s;
int main()
{
	scanf("%s",&s);
	for (i=0;i<6;i++)
	  if (s[i]==49) n++;
	printf("%d\n",n);
	return 0;
}

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

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

string s1,s2;
int ans;

int main()
{
    cin>>s1;
    for(int i=0;i<s1.length();++i) if(s[i]=='1') ans++;
    cout<<ans<<endl; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:39: error: 's' was not declared in this scope
   10 |     for(int i=0;i<s1.length();++i) if(s[i]=='1') ans++;
      |                                       ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
    char c;
    int asn=0;
    while(cin>>c)
    {
        if(c=='1')
        ans++;
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'asn'?
   12 |         ans++;
      |         ^~~
      |         asn
a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'asn'?
   14 |     cout<<ans;
      |           ^~~
      |           asn
Language: C++

#include <bits/stdc++.h>

using namespace std;

int res;
int len;
char ch[10001];

int main() {
    scanf("%s", ch + 1);
    len = strlen(ch + 1);
    for(int i = 1; i <= len; i++) res += ch - '0';
    printf("%d\n", res);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:39: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   12 |     for(int i = 1; i <= len; i++) res += ch - '0';
      |                                   ~~~~^~~~~~~~~~~
      |                                       |
      |                                       char*
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,ans=0;
  cin>>n;
    for(int i=0;i<6;i++){
      if(n[i]==1){
        ans+=1;
      }
    }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid types 'int[int]' for array subscript
    7 |       if(n[i]==1){
      |           ^
Language: C++

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

int main(void){
string s;
int ans=0;
cin>>s;
for(int i=0;i<6;i++){
	if(s[i]=='1')ans++;
}
cout<<ans;
return 0;
}

/*
二重vectorのsortはできないので工夫をしましょう
*

Compiler output:
a.cc:15:1: error: unterminated comment
   15 | /*
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
int main() {
	long long N, a[100000], b[100000];
	std::cin >> N;
	for (int i = 0; i < N; i++)
		std::cin >> a[i] >> b[i];
 
	std::sort(a, a + N);
	std::sort(b, b + N, greater<int>());
 
        std::cout << (a[N - 1] - a[0] - 1)+a[0]+b[N-1] << std::endl;
	return 0;
}

Compiler output:
a.cc:9:1: error: extended character   is not valid in an identifier
    9 |  
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |  
      | ^
a.cc: In function 'int main()':
a.cc:9:1: error: '\U000000a0' was not declared in this scope
    9 |  
      | ^
a.cc:11:29: error: 'greater' was not declared in this scope; did you mean 'std::greater'?
   11 |         std::sort(b, b + N, greater<int>());
      |                             ^~~~~~~
      |                             std::greater
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:353:12: note: 'std::greater' declared here
  353 |     struct greater;
      |            ^~~~~~~
a.cc:11:37: error: expected primary-expression before 'int'
   11 |         std::sort(b, b + N, greater<int>());
      |                                     ^~~
a.cc:12:2: error: expected ';' before 'std'
   12 |  
      |  ^
      |  ;
   13 |         std::cout << (a[N - 1] - a[0] - 1)+a[0]+b[N-1] << std::endl;
      |         ~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<deque>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

int main()
{
	string str;cin >> str;
	int ans = 0;
	REP(i,str.size())
	{
		if(str[i] == '1)ans++;
	}
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc:48:30: warning: missing terminating ' character
   48 |                 if(str[i] == '1)ans++;
      |                              ^
a.cc:48:30: error: missing terminating ' character
   48 |                 if(str[i] == '1)ans++;
      |                              ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:49:9: error: expected primary-expression before '}' token
   49 |         }
      |         ^
a.cc:48:29: error: expected ')' before '}' token
   48 |                 if(str[i] == '1)ans++;
      |                   ~         ^
      |                             )
   49 |         }
      |         ~                    
a.cc:49:9: error: expected primary-expression before '}' token
   49 |         }
      |         ^
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	string s;
	cin>>s;
	int res = 0;
	rep(i, s) res += s[i]-'0';
	cout<<res<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:36: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'll' {aka 'long long int'}
   28 | #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
      |                                    ^~~~~~~
a.cc:45:9: note: in expansion of macro 'rep'
   45 |         rep(i, s) res += s[i]-'0';
      |         ^~~
Language: C++

import std.stdio; // readln
import std.array; // split
import std.conv; // to
import std.typecons;
import std.range;
import std.algorithm;

void main(){
	string s = readln();

	int cnt = 0;
	foreach (elem; s) {
		if(elem == '1') cnt++;
	}
	writeln(cnt);
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio; // readln
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import std.array; // split
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.conv; // to
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import std.typecons;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import std.range;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import std.algorithm;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: '::main' must return 'int'
    8 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'string' was not declared in this scope
    9 |         string s = readln();
      |         ^~~~~~
a.cc:12:18: error: 'elem' was not declared in this scope
   12 |         foreach (elem; s) {
      |                  ^~~~
a.cc:12:24: error: 's' was not declared in this scope
   12 |         foreach (elem; s) {
      |                        ^
a.cc:15:9: error: 'writeln' was not declared in this scope
   15 |         writeln(cnt);
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main() {
    int n=5
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
    }

    int ans=count(a,6,1);
    cout << ans << endl;
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'for'
    6 |     for (int i = 0; i < n; ++i) {
      |     ^~~
a.cc:6:21: error: 'i' was not declared in this scope
    6 |     for (int i = 0; i < n; ++i) {
      |                     ^
a.cc:10:19: error: 'a' was not declared in this scope
   10 |     int ans=count(a,6,1);
      |                   ^
a.cc:10:13: error: 'count' was not declared in this scope
   10 |     int ans=count(a,6,1);
      |             ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main() {
    int n=5
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
    }

    int ans=count(a,6,1)
    cout << ans << endl;
    return 0;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'for'
    6 |     for (int i = 0; i < n; ++i) {
      |     ^~~
a.cc:6:21: error: 'i' was not declared in this scope
    6 |     for (int i = 0; i < n; ++i) {
      |                     ^
a.cc:10:19: error: 'a' was not declared in this scope
   10 |     int ans=count(a,6,1)
      |                   ^
a.cc:10:13: error: 'count' was not declared in this scope
   10 |     int ans=count(a,6,1)
      |             ^~~~~
Language: Java

public class Demo5 {

	public static void main(String[] args) {
		
		Scanner s = new Scanner(System.in);
		String str = s.next();
		char[] c = str.toCharArray();
		int index = 0;
		for (int i = 0; i < c.length; i++) {
			if(c[i]=='1'){
				index++;
			}
		}
		System.out.println(index);
	}
}

Compiler output:
Main.java:1: error: class Demo5 is public, should be declared in a file named Demo5.java
public class Demo5 {
       ^
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Demo5
Main.java:5: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Demo5
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
long a[10000]i,k,l,c,v;
string s;
while(cin>>s)
{
c=0;
for(i=0;i<s.size();i++)
{if(s[i]=='1')
c++;
}
cout<<c<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected initializer before 'i'
    5 | long a[10000]i,k,l,c,v;
      |              ^
a.cc:9:1: error: 'c' was not declared in this scope
    9 | c=0;
      | ^
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<s.size();i++)
      |     ^
Language: C++

#include <bits/stdc+++.h>

using namespace std;

int main()
{

int counter=0;
char c;
int k=6;
while(k--){
cin>>c;
if(c=='1')++counter;
}
cout<<counter;
}

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

#include <bits/stdc++.h>
int main() {
  std::string s; std::cin >> s;
int count = 0;
  for (auto c: s) count += s[i] == '1';
std::cout << count << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:30: error: 'i' was not declared in this scope
    5 |   for (auto c: s) count += s[i] == '1';
      |                              ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
    int sum = 0;
    string x;
  　cin >> x;
    for(int i=0; i < 6; i++){
        if(x[i]=='1'){
            sum = sum+1;
        }
        else{
            sum = sum +0;
        }
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc:10:3: error: extended character 　 is not valid in an identifier
   10 |   　cin >> x;
      |   ^
a.cc: In function 'int main()':
a.cc:10:3: error: '\U00003000cin' was not declared in this scope
   10 |   　cin >> x;
      |   ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int sum = 0;
    string x;
  　cin >> x;
    for(int i=0; i<6; i++){
        if(x[i]=="1"){
            sum = sum+1;
        }
        else{
            sum = sum +0;
        }
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc:9:3: error: extended character 　 is not valid in an identifier
    9 |   　cin >> x;
      |   ^
a.cc: In function 'int main()':
a.cc:9:3: error: '\U00003000cin' was not declared in this scope
    9 |   　cin >> x;
      |   ^~~~~
a.cc:11:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x[i]=="1"){
Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    private string S;
    private void Scan()
    {
        S=Console.ReadLine();
    }
    
    private void Calc()
    {
        Console.WriteLine(S.Count(c=>c=='1'));
    }
    
    public void Solve()
    {
        Scan();
        Calc();
    }
    
    static void Main()
    {
        new Program().Solve();
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:8:12: error: expected ':' before 'string'
    8 |     private string S;
      |            ^~~~~~~
      |            :
a.cc:8:13: error: 'string' does not name a type
    8 |     private string S;
      |             ^~~~~~
a.cc:9:12: error: expected ':' before 'void'
    9 |     private void Scan()
      |            ^~~~~
      |            :
a.cc:14:12: error: expected ':' before 'void'
   14 |     private void Calc()
      |            ^~~~~
      |            :
a.cc:19:11: error: expected ':' before 'void'
   19 |     public void Solve()
      |           ^~~~~
      |           :
a.cc:29:2: error: expected ';' after class definition
   29 | }
      |  ^
      |  ;
a.cc: In member function 'void Program::Scan()':
a.cc:11:9: error: 'S' was not declared in this scope
   11 |         S=Console.ReadLine();
      |         ^
a.cc:11:11: error: 'Console' was not declared in this scope
   11 |         S=Console.ReadLine();
      |           ^~~~~~~
a.cc: In member function 'void Program::Calc()':
a.cc:16:9: error: 'Console' was not declared in this scope
   16 |         Console.WriteLine(S.Count(c=>c=='1'));
      |         ^~~~~~~
a.cc:16:27: error: 'S' was not declared in this scope
   16 |         Console.WriteLine(S.Count(c=>c=='1'));
      |                           ^
a.cc:16:35: error: 'c' was not declared in this scope
   16 |         Console.WriteLine(S.Count(c=>c=='1'));
      |                                   ^
a.cc:16:37: error: expected primary-expression before '>' token
   16 |         Console.WriteLine(S.Count(c=>c=='1'));
      |                                     ^
a.cc: In static member function 'static void Program::Main()':
a.cc:27:22: error: expected ';' before '.' token
   27 |         new Program().Solve();
      |                      ^
Language: C++

main(n,s){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",--s);exit(0);}


Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(n,s){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",--s);exit(0);}
      |     ^
Language: C++

s;main(n){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",s);exit(0);}


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s;main(n){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",s);exit(0);}
      | ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | s;main(n){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",s);exit(0);}
      |       ^
Language: C++

s;main(n){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",s);}


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s;main(n){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",s);}
      | ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | s;main(n){for(scanf("%d",&n);n;s+=n%10,n/=10);printf("%d\n",s);}
      |       ^