<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-144  評論-80  文章-1  trackbacks-0

    package com.faintbear;
    import java.io.*;


    class Input{
         //Read a Sring from kedboard
            public static String getString()
            {
                String string="";
                BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
                try
                {
                    string=br.readLine();
                }
                catch(IOException iox)
                {
                    System.err.println(iox);
                }
            return string;
            }
           
            // read a char from keyboard
            public static char getChar()throws java.io.IOException
            {
                    char cookie;

                    while(true){
                            String string=getString();//Reads the next line of text from the input stream

                            //Check the input
                            if (string.length()>1)
                            {
                                System.err.println("Sorry,You should input a character,");
                                System.err.println("Please input again");
                                continue;
                            }
                            else {
                                    cookie=string.charAt(0) ;
                                    return cookie;
                            }
                    }
            }
           
           
            //read a double number from keyboard
            public static double getDouble( ) 
            {
                double cookie;

                while(true)
                {
                        String string = getString();
                        try
                        {
                            cookie=Double.parseDouble(string);
                            return cookie;
                        }
                        //Check the number
                        catch(NumberFormatException nfe)
                        {
                            System.err.println("Sorry,this is not a double number,plz input again");
                            continue;
                        }
                }
               
            }
           
            //Read a int number from keyboard
            public static int getInt( ) 
            {
                int cookie;
                while(true)
                {
                    String string = getString();
                    try
                    {
                        cookie=Integer.parseInt(string);
                        return cookie;
                    }
                    //Check the input number
                    catch(NumberFormatException nfe)
                    {
                        System.err.println("Sorry,this is not a integer number,plz input again");
                        continue;
                    }
                }
            }
           
            //Read a float number from keyboard
            public static float getFloat()
            {
                float cookie;
                while(true)
                {
                    String string = getString();
                    try
                    {
                        cookie=Float.parseFloat(string);
                        return cookie;
                    }
                    //Check the input number
                    catch(NumberFormatException nfe)
                    {
                        System.err.println("Sorry,this is not a float number,plz input again");
                        continue;
                    }
                }
               
            }

    }

     

     

    package com.faintbear;
    import com.faintbear.Input;
    public class Class1
    {
     public static void main(String[] args)
     {
      System.out.println("請輸入數據");
      System.out.println("******************");
      int kk=Input.getInt();
      System.out.println("l1====="+kk);
     }
    }

    posted on 2005-03-30 23:35 小力力力 閱讀(314) 評論(0)  編輯  收藏 所屬分類: JAVA
    主站蜘蛛池模板: 亚洲成AV人在线观看网址| 亚洲成AV人在线播放无码 | 国产精品永久免费| 亚洲AV无码乱码在线观看富二代| 亚洲中文字幕无码中文| 国产一区二区三区免费看| a级毛片免费播放| 亚洲一区精彩视频| 国产成人毛片亚洲精品| 无遮挡免费一区二区三区 | 久久精品国产亚洲麻豆| 一个人在线观看视频免费| 一级毛片大全免费播放| 亚洲免费电影网站| 91麻豆精品国产自产在线观看亚洲| 18女人腿打开无遮掩免费| 免费国产va在线观看| 亚洲无人区视频大全| 亚洲精品国产免费| 偷自拍亚洲视频在线观看| 78成人精品电影在线播放日韩精品电影一区亚洲 | 亚洲春色在线视频| 毛片在线播放免费观看| 亚洲国产精品成人综合色在线| 亚洲大成色www永久网站| 外国成人网在线观看免费视频| 亚洲一区二区电影| 亚洲午夜精品一级在线播放放| 一级免费黄色大片| 亚洲日本VA午夜在线电影| 免费A级毛片无码A∨男男 | 久久精品国产精品亚洲蜜月| 国产免费av片在线无码免费看| 免费黄色网址网站| 免费黄网站在线看| 亚洲无删减国产精品一区| 久99精品视频在线观看婷亚洲片国产一区一级在线 | 在线亚洲精品视频| 亚洲天堂男人影院| 日韩亚洲Av人人夜夜澡人人爽 | 免费观看黄色的网站|