Pagini recente » Cod sursa (job #2090271) | Cod sursa (job #2399095) | Cod sursa (job #2411317) | Cod sursa (job #1592212) | Cod sursa (job #1430113)
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Adunare {
public static void main(String[] args) {
Scanner reader = null;
try {
reader = new Scanner (new File("ad.in"));
}
catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int a = reader.nextInt();
int b = reader.nextInt();
int sum = a + b;
PrintWriter writer = null;
try {
writer = new PrintWriter (new File("ad.out"));
}
catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
writer.write(String.valueOf(sum) + "\n");
writer.close();
reader.close();
}
}