Pagini recente » Cod sursa (job #616128) | Cod sursa (job #2459950) | Cod sursa (job #786624) | Cod sursa (job #2947181) | Cod sursa (job #1420906)
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
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 razvan
*/
public class Main {
public static void main (String args[]) throws FileNotFoundException {
int a;
int b;
PrintStream console = System.out;
System.setIn(new FileInputStream("adunare.in"));
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
b = sc.nextInt();
int c = a + b;
PrintStream ptr = new PrintStream(new BufferedOutputStream(new FileOutputStream("adunare.out")), true);
System.setOut(ptr);
System.out.println(c);
System.setOut(console);
}
}