<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
    主站蜘蛛池模板: 亚洲精品人成在线观看| 亚洲乱码一区二区三区国产精品| 全黄a免费一级毛片人人爱| 两个人看的www免费高清| kk4kk免费视频毛片| 精品无码一级毛片免费视频观看| 成年免费a级毛片| 国产99视频精品免费视频76| sihu国产精品永久免费| 久久国产乱子伦精品免费午夜| a级毛片免费网站| 久操视频在线免费观看| 四虎在线最新永久免费| 成年免费大片黄在线观看岛国| 成人免费一级毛片在线播放视频| 无码一区二区三区免费视频| 国产成人一区二区三区视频免费| 99精品热线在线观看免费视频| 国产亚洲人成在线影院| 亚洲小说区图片区| 亚洲国产精华液2020| 亚洲男人的天堂在线| 国产午夜亚洲精品国产| 337P日本欧洲亚洲大胆艺术图 | 日本免费大黄在线观看| 18女人水真多免费高清毛片| 久久精品无码专区免费| 日韩视频在线观看免费| 日韩毛片免费无码无毒视频观看| 精品国产免费观看久久久| 国产亚洲精品无码专区| 亚洲国产V高清在线观看| 午夜一级免费视频| 亚洲一区二区三区无码影院| 亚洲av成人一区二区三区在线观看| 无码日韩精品一区二区免费| 国产精品深夜福利免费观看| 中文字幕不卡亚洲| 亚洲国产视频一区| 特级毛片A级毛片100免费播放| 久久国产精品一区免费下载|