Guest User

Untitled

a guest
Jan 23rd, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package zadaniedwa;
  6.  
  7. import java.io.BufferedReader;
  8. import java.io.FileReader;
  9. import java.io.FileWriter;
  10. import java.io.IOException;
  11. import java.util.StringTokenizer;
  12.  
  13. /**
  14.  *
  15.  * @author dom
  16.  */
  17. public class Zadaniedwa {
  18.  
  19.     /**
  20.      * @param args the command line arguments
  21.      */
  22.     public static void main(String[] args) {
  23.         // TODO code application logic here
  24.        
  25.          try {
  26.         FileReader fr = new FileReader("anagram.txt");
  27.         BufferedReader br = new BufferedReader(fr);
  28.  
  29.         FileWriter fwzad2 = new FileWriter("zadanie2.txt");
  30.        
  31.         String a,s;
  32.        
  33.  
  34.        while ((s = br.readLine()) != null) {
  35.        StringTokenizer slowo = new StringTokenizer(s,"\n");
  36.        a=slowo.nextToken();
  37.        System.out.print(s);
  38.        }
  39.        
  40.        
  41.         br.close();
  42.         fwzad2.close();
  43.         } catch (IOException e) {
  44.         System.out.println("Blad w odczycie pliku");
  45.  
  46.         }
  47.        
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment