use std::io; use std::io::{Stdin, BufRead}; struct Input { a: i32, b: i32, s: String, } fn main() { let mut stdin = io::stdin(); let input = read_input(&mut stdin); solve(input); } fn read_input(stdin: &mut Stdin) -> Input { let mut lock = stdin.lock(); let mut s = String::new(); lock.read_line(&mut s).expect("can't read 1st line."); let tokens: Vec = s.trim_end().split(" ").map(|s| s.parse().expect("can't parse")).collect(); s.clear(); lock.read_line(&mut s).expect("can't read 1st line."); Input { a: tokens[0], b: tokens[1], s: s.trim_end().to_string() } } fn solve(input: Input) { println!("{} {}", input.a + input.b, input.s); }