Cod sursa(job #1430745)

Utilizator Popescu_Ovidiu_Ioan_322CBPopescu Ovidiu Popescu_Ovidiu_Ioan_322CB Data 8 mai 2015 19:34:27
Problema A+B Scor 0
Compilator java Status done
Runda Arhiva de probleme Marime 0.95 kb
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;



public class Adunare {
	static long a;
	static long c;
	static long res;
	public static void main(String[] args) {
		BufferedReader b = null;
		try {
			String sCurrentLine;
			b = new BufferedReader(new FileReader("adunare.in"));
			
			sCurrentLine = b.readLine();
			
			a = Integer.parseInt(sCurrentLine.split(" ")[0]);
			sCurrentLine = b.readLine();
			c = Integer.parseInt(sCurrentLine.split(" ")[0]);
					
				
		}

		
		catch (Exception e) {
			e.printStackTrace();
		} 
		res = a+c;
		try {
			File kcol = new File("adunare.out");
			if (!kcol.exists()) {
				kcol.createNewFile();
			}

			FileWriter write = new FileWriter(kcol);
			
				write.write(""+res );
		
			write.close();
			}
			
			catch (IOException e) {
				e.printStackTrace();
			}
		
		
		
		
	}

}