fn main() { //標準入力処理は https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より引用 let s = { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); s.trim_right().to_owned() }; let mut v = 0; for i in 0..s.len() { let n: u32 = s.chars().nth(i).unwrap() as u32; v += n - 48; } println!("{}", v); }