Cod sursa(job #2830041)

Utilizator bcebereBogdan Cebere bcebere Data 9 ianuarie 2022 13:42:46
Problema A+B Scor 100
Compilator rs Status done
Runda Arhiva de probleme Marime 0.37 kb
use std::fs::File;
use std::io::{self, BufRead};
use std::fs;

fn main() {
    let file = File::open("adunare.in").unwrap();
    let mut lines = io::BufReader::new(file).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();
}