Pagini recente » Istoria paginii runda/biro_daily_quest_no.1 | Cod sursa (job #1088747) | Cod sursa (job #1318059) | Cod sursa (job #3041329) | Cod sursa (job #2596569)
//package Probleme;
import java.util.Scanner;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.File;
public class Main {
public void read() throws IOException {
int s = 0;
try {
File myObj = new File("adunare.in");
Scanner myReader = new Scanner(myObj);
int x = myReader.nextInt();
int y = myReader.nextInt();
s = x + y;
System.out.println(s);
myReader.close();
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
FileWriter fileWriter = new FileWriter("adunare.out");
PrintWriter pw = new PrintWriter(fileWriter);
pw.print(s);
pw.close();
}
public static void main(String[] args) throws IOException {
Main suma = new Main();
suma.read();
return 0;
}
}