Pagini recente » Istoria paginii runda/franceza/clasament | Cod sursa (job #2421811) | Cod sursa (job #1052422) | Clasament leiten | Cod sursa (job #1430523)
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 Main {
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);
}
}