Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. package com.javarush.task.task18.task1818;
  2.  
  3. /*
  4. Два в одном
  5. */
  6.  
  7. import java.io.*;
  8.  
  9. public class Solution
  10. {
  11. public static void main(String[] args) throws IOException
  12. {
  13. BufferedReader reader = new BufferedReader (new InputStreamReader (System.in));
  14. String name1 = reader.readLine ( );
  15. String name2 = reader.readLine ( );
  16. String name3 = reader.readLine ( );
  17. // name1="c:/1.txt";
  18. // name2="c:/2.txt";
  19. // name3="c:/3.txt";
  20. FileOutputStream f1 = new FileOutputStream (name1);
  21. FileInputStream f2 = new FileInputStream (name2);
  22. FileInputStream f3 = new FileInputStream (name3);
  23. byte[] b = new byte[3];
  24. while (f2.available ( ) > 0)
  25. {
  26. int c = f2.read (b);
  27. f1.write (b, 0, c);
  28. }
  29. while (f3.available ( ) > 0)
  30. {
  31. int c = f3.read (b);
  32. f1.write (b, 0, c);
  33.  
  34. }
  35. f1.close ( );
  36. f2.close ( );
  37. f3.close ( );
  38. reader.close ( );
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement