Pagini recente » Cod sursa (job #1432431) | Cod sursa (job #1431279)
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Bogdan
*/
public class Main {
public static void main(String[] args) {
try {
Scanner sc = new Scanner (new FileInputStream ("adunare.in"));
int a = sc.nextInt();
int b = sc.nextInt();
int c = a + b;
PrintWriter fw = new PrintWriter("adunare.out");
fw.write(String.valueOf(c));
fw.close();
sc.close();
}
catch (IOException e) {
System.out.println("Nu exista fisierul");
}
}
}