Cod sursa(job #1429954)

Utilizator Sonea_Andreea_323CBSonea Andreea Sonea_Andreea_323CB Data 7 mai 2015 17:14:24
Problema A+B Scor 0
Compilator java Status done
Runda Arhiva de probleme Marime 0.78 kb
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;


public class Main {
	
	public static void main(String[] args) {
		Scanner scan = null;
		BufferedWriter out = null;
		try {
			scan = new Scanner(new File("adunare.in"));
			out = new BufferedWriter(new FileWriter(new File("adunare.out")));
			int a = scan.nextInt();
			int b = scan.nextInt();
			out.write(Integer.toString(a+b));
			
		} catch ( IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			if (out != null) {
				try {
					out.close();
					scan.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}
}