Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.PrintWriter;
- import java.util.Scanner;
- public class kloodL2_A {
- public static void main(String[] args) throws FileNotFoundException {
- File inFile1 = new File("A.dat");
- File inFile2 = new File("B.dat");
- PrintWriter outFile = new PrintWriter("C.dat");
- Scanner sc1 = new Scanner(inFile1);
- Scanner sc2 = new Scanner(inFile2);
- while(sc1.hasNext() && sc2.hasNext()) {
- int a = sc1.nextInt();
- int b = sc2.nextInt();
- int suma = a + b;
- outFile.println(suma);
- }
- outFile.close();
- sc1.close();
- sc2.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement