现在的位置: 首页 > 综合 > 正文

文本编辑器的粗略设计

2013年09月02日 ⁄ 综合 ⁄ 共 723字 ⁄ 字号 评论关闭
 

package com.jzm.ConsoleInputOut;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class InputOut1 {
 /**
  * @param args
  * @throws IOException
  */
 public static void main(String[] args) throws IOException {
  PrintWriter pw = new PrintWriter(System.out,true);
     String xString []= new String[100];
     String string = null;
  pw.println("请输入一个字符串:");  
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       int i = 0;     
       for (int j = 0; j < 100; j++) {   
         string =   br.readLine();        
      if(string.equals("stop")){
                 break;
      }
      xString[i++]  = string;
        }  
       
       for (int j = 0; j <i; j++) {  
          pw.println(xString[j]);
        }
 }
}

抱歉!评论已关闭.