complete 1644.rs 2887.rs 15552.rs 24767.rs 25710.rs 34031.rs
This commit is contained in:
24
storage/zeta/rs/completed/15552.rs
Normal file
24
storage/zeta/rs/completed/15552.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use std::io::{stdin, stdout, BufWriter};
|
||||
use std::io::{BufRead, Write};
|
||||
|
||||
fn main() {
|
||||
let stdout = stdout();
|
||||
let mut out = BufWriter::new(stdout.lock());
|
||||
|
||||
let mut line = String::new();
|
||||
stdin().read_line(&mut line).unwrap();
|
||||
let n: usize = line.trim_end().parse().unwrap();
|
||||
line.clear();
|
||||
for _ in 0..n {
|
||||
stdin().read_line(&mut line).unwrap();
|
||||
let s = line
|
||||
.trim_end()
|
||||
.split_ascii_whitespace()
|
||||
.map(|x| x.parse::<u16>().unwrap())
|
||||
.sum::<u16>();
|
||||
line.clear();
|
||||
|
||||
//println!("{}", s);
|
||||
writeln!(out, "{}", s).unwrap();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user