Pagini recente » Cod sursa (job #25545) | Cod sursa (job #310925) | Cod sursa (job #1793515) | Cod sursa (job #1890731) | Cod sursa (job #1431230)
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main (String args[]){
try {
Scanner sc = new Scanner (new FileInputStream("adunare.in"));
int a = sc.nextInt() ;
int b = sc.nextInt() ;
int suma = a + b;
FileWriter writer = new FileWriter("adunare.out");
writer.write(suma);
writer.flush();
writer.close();
sc.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}