Advertisement
Josif_tepe

Untitled

Mar 23rd, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.io.*;
  2. public class Main {
  3.  
  4.     public static void main(String[] args) {
  5.         FileOutputStream out = null;
  6.         try {
  7.             out = new FileOutputStream("out.txt");
  8.             while(true) {
  9.                 int x = System.in.read();
  10.                 if(x == 10) {
  11.                     break;
  12.                 }
  13.                 else {
  14.                     out.write(x);
  15.                 }
  16.             }
  17.         }
  18.         catch (IOException ex) {
  19.             System.out.println(ex);
  20.         }
  21.  
  22.  
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement