Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package zadaniedwa;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.util.StringTokenizer;
- /**
- *
- * @author dom
- */
- public class Zadaniedwa {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- try {
- FileReader fr = new FileReader("anagram.txt");
- BufferedReader br = new BufferedReader(fr);
- FileWriter fwzad2 = new FileWriter("zadanie2.txt");
- String a,s;
- while ((s = br.readLine()) != null) {
- StringTokenizer slowo = new StringTokenizer(s,"\n");
- a=slowo.nextToken();
- System.out.print(s);
- }
- br.close();
- fwzad2.close();
- } catch (IOException e) {
- System.out.println("Blad w odczycie pliku");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment