Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class HW01_3 {
- public static void main(String[] args) throws IOException {
- BufferedReader br=new BufferedReader(new FileReader("izvor.txt"));
- StringBuilder st=new StringBuilder();
- String line=br.readLine();
- while(line!=null){
- String [] niza=line.split(" ");
- for(String b: niza){
- st.append(b +" ");
- }
- line=br.readLine();
- }
- st.reverse();
- PrintWriter pv=new PrintWriter(new FileOutputStream("destinacija.txt"));
- pv.println(st.toString());
- pv.flush();
- pv.close();
- }
- }
Add Comment
Please, Sign In to add comment