Pagini recente » Cod sursa (job #930950) | Cod sursa (job #860943) | Cod sursa (job #1890695) | Cod sursa (job #2930364) | Cod sursa (job #1727853)
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Adunare {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 0,b = 0,s;
File in=new File("adunare.in");
File out=new File("adunare.out");
try {
Scanner s1=new Scanner(in);
a=s1.nextInt();
b=s1.nextInt();
s1.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
s=a+b;
try {
FileWriter fw=new FileWriter(out);
PrintWriter pw=new PrintWriter(fw);
pw.println(s);
pw.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}