Pagini recente » Cod sursa (job #1431298) | Cod sursa (job #1431478) | Cod sursa (job #1430466) | Cod sursa (job #1431814) | Cod sursa (job #1431264)
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
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 File ("adunare.in"));
int a = sc.nextInt();
int b = sc.nextInt();
int c = a + b;
FileWriter fw = new FileWriter("adunare.out");
fw.write(c);
}
catch (IOException e) {
System.out.println("Nu exista fisierul");
}
}
}