solutions: 2062A
This commit is contained in:
parent
7a02ae5ba6
commit
77b1df96cb
1 changed files with 23 additions and 0 deletions
23
solutions/rust/src/bin/2062A.rs
Normal file
23
solutions/rust/src/bin/2062A.rs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut s = String::new();
|
||||||
|
io::stdin().read_line(&mut s).unwrap();
|
||||||
|
|
||||||
|
let t: u64 = s.trim().parse().unwrap();
|
||||||
|
|
||||||
|
for _ in 0..t {
|
||||||
|
let mut s = String::new();
|
||||||
|
io::stdin().read_line(&mut s).unwrap();
|
||||||
|
|
||||||
|
let mut count = 0;
|
||||||
|
|
||||||
|
for i in s.chars() {
|
||||||
|
if i == '1' {
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{}", count);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue