Pagini recente » Cod sursa (job #1231887) | Cod sursa (job #2085316) | Cod sursa (job #1627877) | Cod sursa (job #2873825) | Cod sursa (job #2708498)
package com.company;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try {
FileInputStream fin = new FileInputStream("adunare.in");
FileOutputStream fout = new FileOutputStream("adunare.out");
Scanner scanner = new Scanner(fin);
int a = scanner.nextInt();
int b = scanner.nextInt();
fout.write(String.format("%d", a + b).getBytes(StandardCharsets.UTF_8));
fout.close();
fin.close();
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}