Pagini recente » Cod sursa (job #2187878) | tema | Cod sursa (job #2516986) | Monitorul de evaluare | Cod sursa (job #2442922)
package org.alex.learn;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
FileInputStream fileInputStream = null;
PrintWriter fileOutputPrinter = null;
try {
fileInputStream = new FileInputStream("adunare.in");
fileOutputPrinter = new PrintWriter("adunare.out");
Scanner scanner = new Scanner(fileInputStream);
fileOutputPrinter.println(scanner.nextLong() + scanner.nextLong());
long sum = 0;
scanner.close();
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
if (fileOutputPrinter != null) {
fileOutputPrinter.close();
}
}
}
}