Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.io.FileWriter;
  3. import java.io.BufferedWriter;
  4. import java.io.IOException;
  5.  
  6. class CmdInputTest {
  7.  
  8.     public static void main(String args[]) throws IOException{
  9.         Scanner sc = new Scanner(System.in);
  10.         String str = "";
  11.         FileWriter fw = new FileWriter("outputs.txt");
  12.         BufferedWriter bw = new BufferedWriter(fw);
  13.         while(!str.equals("exit")) {
  14.             str = sc.next();
  15.             //System.out.println(str);
  16.             bw.write(str + "\n");
  17.         }
  18.         bw.close();
  19.         fw.close();
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement