Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

string s;
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

string s;#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

string s;

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

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

Compiler output:
a.cc:122:10: error: stray '#' in program
  122 | string s;#include <iostream>
      |          ^
a.cc:93:10: error: redefinition of 'const ll INF'
   93 | const ll INF = 1e16;
      |          ^~~
a.cc:32:10: note: 'const ll INF' previously defined here
   32 | const ll INF = 1e16;
      |          ^~~
a.cc:94:10: error: redefinition of 'const ll MOD'
   94 | const ll MOD = 1e9 + 7;
      |          ^~~
a.cc:33:10: note: 'const ll MOD' previously defined here
   33 | const ll MOD = 1e9 + 7;
      |          ^~~
a.cc:106:4: error: redefinition of 'll sq(ll)'
  106 | ll sq(ll num) { return num*num; }
      |    ^~
a.cc:45:4: note: 'll sq(ll)' previously defined here
   45 | ll sq(ll num) { return num*num; }
      |    ^~
a.cc:107:4: error: redefinition of 'll mod_pow(ll, ll)'
  107 | ll mod_pow(ll x, ll n) {
      |    ^~~~~~~
a.cc:46:4: note: 'll mod_pow(ll, ll)' previously defined here
   46 | ll mod_pow(ll x, ll n) {
      |    ^~~~~~~
a.cc:118:4: error: redefinition of 'll mod_add(ll, ll)'
  118 | ll mod_add(ll a, ll b) { return (a + b) % MOD; }
      |    ^~~~~~~
a.cc:57:4: note: 'll mod_add(ll, ll)' previously defined here
   57 | ll mod_add(ll a, ll b) { return (a + b) % MOD; }
      |    ^~~~~~~
a.cc:119:4: error: redefinition of 'll mod_sub(ll, ll)'
  119 | ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
      |    ^~~~~~~
a.cc:58:4: note: 'll mod_sub(ll, ll)' previously defined here
   58 | ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
      |    ^~~~~~~
a.cc:120:4: error: redefinition of 'll mod_mul(ll, ll)'
  120 | ll mod_mul(ll a, ll b) { return a*b % MOD; }
      |    ^~~~~~~
a.cc:59:4: note: 'll mod_mul(ll, ll)' previously defined here
   59 | ll mod_mul(ll a, ll b) { return a*b % MOD; }
      |    ^~~~~~~
a.cc:122:8: error: redefinition of 'std::string s'
  122 | string s;#include <iostream>
      |        ^
a.cc:61:8: note: 'std::string s' previously declared here
   61 | string s;
      |        ^
a.cc:122:11: error: 'include' does not name a type
  122 | string s;#include <iostream>
      |           ^~~~~~~
a.cc:153:10: error: redefinition of 'const ll INF'
  153 | const ll INF = 1e16;
      |          ^~~
a.cc:32:10: note: 'const ll INF' previously defined here
   32 | const ll INF = 1e16;
      |          ^~~
a.cc:154:10: error: redefinition of 'const ll MOD'
  154 | const ll MOD = 1e9 + 7;
      |          ^~~
a.cc:33:10: note: 'const ll MOD' previously defined here
   33 | const ll MOD = 1e9 + 7;
      |          ^~~
a.cc:166:4: error: redefinition of 'll sq(ll)'
  166 | ll sq(ll num) { return num*num; }
      |    ^~
a.cc:45:4: note: 'll sq(ll)' previously defined here
   45 | ll sq(ll num) { return num*num; }
      |    ^~
a.cc:167:4: error: redefinition of 'll mod_pow(ll, ll)'
  167 | ll mod_pow(ll x, ll n) {
      |    ^~~~~~~
a.cc:46:4: note: 'll mod_pow(ll, ll)' previously defined here
   46 | ll mod_pow(ll x, ll n) {
      |    ^~~~~~~
a.cc:178:4: error: redefinition of 'll mod_add(ll, ll)'
  178 | ll mod_add(ll a, ll b) { return (a + b) % MOD; }
      |    ^~~~~~~
a.cc:57:4: note: 'll mod_add(ll, ll)' previously defined here
   57 | ll mod_add(ll a, ll b) { return (a + b) % MOD; }
      |    ^~~~~~~
a.cc:179:4: error: redefinition of 'll mod_sub(ll, ll)'
  179 | ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
      |    ^~~~~~~
a.cc:58:4: note: 'll mod_sub(ll, ll)' previously defined here
   58 | ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
      |    ^~~~~~~
a.cc:180:4: error: redefinition of 'll mod_mul(ll, ll)'
  180 | ll mod_mul(ll a, ll b) { return a*b % MOD; }
      |    ^~~~~~~
a.cc:59:4: note: 'll mod_mul(ll, ll)' previously defined here
   59 | ll mod_mul(ll a, ll b) { return a*b % MOD; }
      |    ^~~~~~~
a.cc:182:8: error: redefinition of 'std::string s'
  182 | string s;
      |        ^
a.cc:61:8: note: 'std::string s' previously declared here
   61 | string s;
      |        ^
a.cc:193:5: error: redefinition of 'int main()'
  193 | int main(){
      |     ^~~~
a.cc:184:5: note: 'int main()' previously defined here
  184 | int main(){
      |     ^~~~
a.cc:201:5: error: redefinition of 'int main()'
  201 | int main(){
      |     ^~~~
a.cc:184:5: note: 'int main()' previously defined here
  184 | int main(){
      |     ^~~~