Cod sursa(job #2916642)
Utilizator | Data | 31 iulie 2022 10:06:01 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | rs | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
use std::{
fs::{self, File},
io::{BufRead, BufReader},
};
fn main() {
let fin = File::open("adunare.in").expect("no input file");
let reader = BufReader::new(fin);
let mut lines = reader.lines();
let a = lines.next().unwrap().unwrap().parse::<i32>().unwrap();
let b = lines.next().unwrap().unwrap().parse::<i32>().unwrap();
fs::write("adunare.out", (a + b).to_string()).unwrap();
}