Pagini recente » Cod sursa (job #2000471) | Cod sursa (job #1074933) | Cod sursa (job #1222770) | Cod sursa (job #1452789) | Cod sursa (job #1727857)
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
class Main {
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();
}
}
}