Cod sursa(job #1430531)

Utilizator darien94Darien darien94 Data 8 mai 2015 16:09:17
Problema A+B Scor 0
Compilator java Status done
Runda Arhiva de probleme Marime 0.86 kb

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Marius
 */
public class Main {
    
    public static void parsareFisier(String filename) throws FileNotFoundException, IOException{
        Scanner scan = new Scanner(new FileReader(filename));
        int a = scan.nextInt();
        int b = scan.nextInt();
        scan.close();
        FileWriter f = new FileWriter("adunare.out");
        f.write(a+b);
        f.close();
    }
    
    public static void main(String[] args) throws IOException{
        parsareFisier("adunare.in");
    }
}