zoukankan      html  css  js  c++  java
  • 小练习

    import java.util.*;
    import java.io.*;
    
    
    public class ListWords {
    
    private ArrayList<String> al=new ArrayList<String>();
    private BufferedReader br;
    private BufferedWriter bw;
    private String readline;
    private String[] strs;
    
        static {
    
            System.out.println("He said that's a not a good idea");
    
        }
    
         ListWords() {
    
            try {
    
                bw=new BufferedWriter(new OutputStreamWriter(System.out));
                br=new BufferedReader(new InputStreamReader(System.in));
    
            }catch (Exception e) {
    
                e.getMessage();
            }
    
         }
    
    
         public void getListWords() throws Exception {
    
             while ((readline=br.readLine())!=null) {
    
                 if (readline.equals("end")) {
    
                     break;
                 }
    
                 strs=readline.split(" ");
    
                 for(String s:strs) {
    
                     al.add(s);
                     bw.write(s+" ");
                     bw.flush();
                 }
    
                 System.out.println(); //换行
             }
    
             System.out.print("共有"+al.size()+"个单词: ");
    
              for(String i:al) {
    
                  System.out.print(i+" ");
              }
    
             bw.close();
    
         }
    
        public static void main(String[] args) throws Exception {
    
            ListWords lw =new ListWords();
            lw.getListWords();
        }
    
    }
  • 相关阅读:
    稠密光流
    分水岭分割
    Haar小波分析
    内积空间
    矩阵LU分解
    opencv笔记---contours
    Deformable Templates For Eye Detection
    最小二乘法
    字符集及编码
    层次聚类
  • 原文地址:https://www.cnblogs.com/ltb6w/p/8279035.html
Copyright © 2011-2022 走看看