Advertisement
Josif_tepe

Untitled

Mar 25th, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.logging.Filter;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.         // ispecati gi site soglaski
  8.         try {
  9.             FileOutputStream fout = new FileOutputStream("out.txt");
  10.             CFilter customout = new CFilter(fout);
  11.             for(int i = System.in.read(); i != 'X'; i = System.in.read()) {
  12.                 customout.write(i);
  13.             }
  14.         }
  15.         catch (IOException ex) {
  16.             System.out.println(ex);
  17.         }
  18.     }
  19. }
  20. class CFilter extends FilterOutputStream {
  21.     public CFilter(OutputStream out) {
  22.         super(out);
  23.     }
  24.     @Override
  25.     public void write(int b) {
  26.         if(!(b == 65 || b == 69 || b == 73 || b == 79 || b == 85)) {
  27.             try {
  28.                 super.write(b);
  29.             }
  30.             catch (IOException ex) {
  31.  
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement