Pagini recente » Cod sursa (job #396603) | Cod sursa (job #736171) | Cod sursa (job #2517908) | Cod sursa (job #691420) | Cod sursa (job #1430521)
import java.io.FileNotFoundException;
import java.io.FileReader;
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 Marius
*/
public class adunare {
static int a, b;
public static void parsareFisier(String filename) throws FileNotFoundException{
Scanner scan = new Scanner(new FileReader(filename));
a = scan.nextInt();
b = scan.nextInt();
}
public static void main(String args) throws IOException{
parsareFisier("adunare.in");
FileWriter f = new FileWriter("adunare.out");
f.write(a+b);
}
}