Pagini recente » Cod sursa (job #712228) | Cod sursa (job #2759852) | Cod sursa (job #1021180) | Cod sursa (job #1350117) | Cod sursa (job #1431307)
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();
}
}
}