Cod sursa(job #1431279)

Utilizator George_Bogdan.Oprea_323CCGeorgeBogdanOprea323CC George_Bogdan.Oprea_323CC Data 9 mai 2015 10:02:30
Problema A+B Scor 100
Compilator java Status done
Runda Arhiva de probleme Marime 0.91 kb

import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
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 Bogdan
 */
public class Main {
    public static void main(String[] args) {

        try {
            Scanner sc = new Scanner (new FileInputStream ("adunare.in"));
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = a + b;
            PrintWriter fw = new PrintWriter("adunare.out");
            fw.write(String.valueOf(c));
            fw.close();
            sc.close();
        }
        catch (IOException e) {
                System.out.println("Nu exista fisierul");
        }
    }
}