Cod sursa(job #2216776)

Utilizator CharlieWashingtonCharlie Washington CharlieWashington Data 27 iunie 2018 21:03:45
Problema A+B Scor 0
Compilator java Status done
Runda Arhiva de probleme Marime 0.77 kb
import java.io.*;
import java.util.*;

class Main
{
    public static void main (String[] args)
    {
    	Scanner input = null;
    	PrintStream output = null;


    	int firstNumber, secondNumber, sum;

    	try
    	{

    		input = new Scanner(new File("adunare.in"));
    		output = new PrintStream("adunare.out");

    		// read the numbers from the file
    		firstNumber = input.nextInt();
    		secondNumber = input.nextInt();
    		// compute the sum of the 2 numbers
    		sum = firstNumber + secondNumber;

    		// print the sum in to the output file
    		output.print(sum);
    		output.flush();

    		// close the 2 files
    		input.close();
    		output.close();

    	}
    	catch (IOException exception)
    	{
    		System.err.println(exception);
    	}
    }
}