Cod sursa(job #1402820)

Utilizator katakonst94Pirvu Constantin Catalin katakonst94 Data 26 martie 2015 21:11:57
Problema A+B Scor 0
Compilator java Status done
Runda Arhiva de probleme Marime 1.52 kb
/*
 * 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.
 */

package a.b;

import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Kata
 */
 class AB {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            // TODO code application logic here

            Scanner in=new Scanner (new FileInputStream("adunare.in"));
            DataOutputStream  out = new DataOutputStream (new FileOutputStream("adunare.out"));            
            int a=Integer.parseInt(in.next());
            int b=Integer.parseInt(in.next());
          out.writeUTF(String.valueOf(a+b));
            //out.flush();
            out.close();
            in.close();
            
        } catch (FileNotFoundException ex) {
            Logger.getLogger(AB.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(AB.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}