Update solution for A+B_-_4 w/ id 18474280
Time: 4ms MemUsage: 13036KB
This commit is contained in:
18
baekjoon/A+B_-_4/solution_18474280.rs
Normal file
18
baekjoon/A+B_-_4/solution_18474280.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use std::io;
|
||||
|
||||
fn main(){
|
||||
loop{
|
||||
let mut line = String::new();
|
||||
let byte = io::stdin().read_line(&mut line).expect("Failed to read line");
|
||||
|
||||
if byte <= 1{ // only '\n' is input
|
||||
break;
|
||||
}
|
||||
|
||||
let inputs: Vec<u32> = line.trim().split(" ")
|
||||
.map(|x| x.parse().expect("Not an integer!"))
|
||||
.collect();
|
||||
|
||||
println!("{}", inputs[0] + inputs[1]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user