-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task.txt
29 lines (26 loc) · 955 Bytes
/
Task.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.io.*;
public class Task {
public static void main(String[] args)throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String name1 = reader.readLine();
String name2 = reader.readLine();
String name3 = reader.readLine();
FileOutputStream file1 = new FileOutputStream(name1);
FileInputStream file2 = new FileInputStream(name2);
FileInputStream file3 = new FileInputStream(name3);
byte[] f2 = new byte[file2.available()];
byte[] f3 = new byte[file3.available()];
while (file2.available() > 0){
int data = file2.read(f2);
file1.write(f2);
}
while (file3.available() > 0){
int data = file3.read(f3);
file1.write(f3, file2.available(), data);
}
reader.close();
file1.close();
file2.close();
file3.close();
}
}