Pagini recente » Cod sursa (job #480676) | Cod sursa (job #935415) | Cod sursa (job #3240712) | Cod sursa (job #2426884) | Cod sursa (job #2652899)
import java.util.Scanner;
import java.io.*;
import java.io.FileNotFoundException;
import java.lang.Exception;
public class Main{
public static void main(String args[]) throws FileNotFoundException{
File file = new File("adunare.in");
Scanner sc;
try{
sc = new Scanner(file);
}
catch (FileNotFoundException e){
System.out.println("File not found");
return;
}
int n = sc.nextInt();
int m = sc.nextInt();
try{
Writer wr = new FileWriter("adunare.out");
wr.write(String.valueOf(n+m) + "\n");
wr.close();
}
catch(Exception e){
System.out.println("Exceptie");
}
}
}