Pagini recente » Cod sursa (job #127669) | Cod sursa (job #1431069) | Cod sursa (job #3223392) | Cod sursa (job #1431229) | Cod sursa (job #1430926)
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Main {
static long a;
static long c;
static long res;
public static void main(String[] args) {
BufferedReader b = null;
try {
String sCurrentLine;
b = new BufferedReader(new FileReader("adunare.in"));
sCurrentLine = b.readLine();
a = Integer.parseInt(sCurrentLine.split(" ")[0]);
sCurrentLine = b.readLine();
c = Integer.parseInt(sCurrentLine.split(" ")[0]);
}
catch (Exception e) {
e.printStackTrace();
}
res = a+c;
try {
File kcol = new File("adunare.out");
if (!kcol.exists()) {
kcol.createNewFile();
}
FileWriter write = new FileWriter(kcol);
write.write(""+res );
write.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
}