Chào mừng đến với Diễn đàn lập trình - Cộng đồng lập trình.
Kết quả 1 đến 3 của 3
  1. #1
    Ngày tham gia
    Sep 2015
    Bài viết
    0

  2. #2
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Bài 6 : chuẩn hóa chuỗi. Lâu quá rồi không code nữa nen chắc code dư tùm lum tùm la


    Mã:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package baitap;
    
    /**
     *
     * @author HP
     * 
     */
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.StringTokenizer;
    public class Baitap {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
              BufferedReader readline = new BufferedReader(new
              InputStreamReader( System.in) );
              
              System.out.println("Nhap chuoi vao: ");
              try
              {
              String str=readline.readLine();
              StringTokenizer strtokenizer = new StringTokenizer(str);
              System.out.println("So tu cua chuoi da nhap: "+strtokenizer.countTokens());
              System.out.println("Chuoi da loai khoang trang: ");
              while(strtokenizer.hasMoreElements())
              {
                  System.out.print(" "+strtokenizer.nextToken());
                 
                  
              }
              System.out.println();
              }catch(Exception e)
              {
                  
              }
        }
    }

  3. #3
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    giaixongne.rarthanks nhiều, cuối cùng mình củng làm xong rồi, ai cần thì lấy về học nhé

 

 

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •