Language: C++

#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

pub trait InputValue {
    fn parse(s: &str) -> Self;
}

pub fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

pub fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B);
parse_tuple!(A, B, C);
parse_tuple!(A, B, C, D);
parse_tuple!(A, B, C, D, E);

// ===

fn main() {
    let s: String = read();
    let mut cnt = 0;
    for c in s.into_bytes() {
        if c == b'1' {
            cnt += 1;
        }
    }
    println!("{}", cnt);
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #![allow(unused_imports)]
      |  ^
a.cc:20:14: error: too many decimal points in number
   20 |     for _ in 0..n {
      |              ^~~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::io::*;
      | ^~~
a.cc:3:1: error: 'use' does not name a type
    3 | use std::fmt::*;
      | ^~~
a.cc:4:1: error: 'use' does not name a type
    4 | use std::str::*;
      | ^~~
a.cc:5:1: error: 'use' does not name a type
    5 | use std::cmp::*;
      | ^~~
a.cc:6:1: error: 'use' does not name a type
    6 | use std::collections::*;
      | ^~~
a.cc:8:1: error: 'pub' does not name a type
    8 | pub trait InputValue {
      | ^~~
a.cc:12:1: error: 'pub' does not name a type
   12 | pub fn read<T: InputValue>() -> T {
      | ^~~
a.cc:18:1: error: 'pub' does not name a type
   18 | pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
      | ^~~
a.cc:26:1: error: 'pub' does not name a type
   26 | pub fn readnc<T: InputValue>() -> Vec<T> {
      | ^~~
a.cc:35:1: error: 'macro_rules' does not name a type
   35 | macro_rules! parse_single_value {
      | ^~~~~~~~~~~
a.cc:44:1: error: 'parse_single_value' does not name a type
   44 | parse_single_value!(i32, i64, f32, f64, usize, String);
      | ^~~~~~~~~~~~~~~~~~
a.cc:46:1: error: 'macro_rules' does not name a type
   46 | macro_rules! parse_tuple {
      | ^~~~~~~~~~~
a.cc:57:1: error: 'parse_tuple' does not name a type
   57 | parse_tuple!(A, B);
      | ^~~~~~~~~~~
a.cc:58:1: error: 'parse_tuple' does not name a type
   58 | parse_tuple!(A, B, C);
      | ^~~~~~~~~~~
a.cc:59:1: error: 'parse_tuple' does not name a type
   59 | parse_tuple!(A, B, C, D);
      | ^~~~~~~~~~~
a.cc:60:1: error: 'parse_tuple' does not name a type
   60 | parse_tuple!(A, B, C, D, E);
      | ^~~~~~~~~~~
a.cc:64:1: error: 'fn' does not name a type
   64 | fn main() {
      | ^~