Cod sursa(job #1431307)

Utilizator Dragnea_Andrei_Silviu_323CADragnea Andrei Silviu Dragnea_Andrei_Silviu_323CA Data 9 mai 2015 10:20:42
Problema A+B Scor 0
Compilator java Status done
Runda Arhiva de probleme Marime 0.76 kb
package adunare_java;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner fin = null;
		try {
			fin = new Scanner(new File("adunare.in"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}

		Writer fout = null;
		try {
			fout = new FileWriter("adunare.out");
		} catch (IOException e) {
			e.printStackTrace();
		}

		int a = fin.nextInt();
		int b = fin.nextInt();

		try {
			fout.write(Integer.toString(a + b));
		} catch (IOException e) {
			e.printStackTrace();
		}

		fin.close();
		try {
			fout.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}