<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 小力力力 閱讀(320) 評論(0)  編輯  收藏 所屬分類: JAVA
    主站蜘蛛池模板: 国产精品国产自线拍免费软件| 国产亚洲精久久久久久无码77777 国产亚洲精品成人AA片新蒲金 | 有色视频在线观看免费高清在线直播 | 久久精品国产这里是免费| 免费精品国偷自产在线在线| 免费国产精品视频| 久久精品国产亚洲AV无码娇色| 亚洲最大无码中文字幕| 国产又黄又爽又大的免费视频| 嫖丰满老熟妇AAAA片免费看| 亚洲精品视频在线观看免费 | 中文字幕 亚洲 有码 在线| 一个人看的www在线免费视频| 久久久久av无码免费网| 国产精品亚洲视频| 亚洲AV一区二区三区四区| 91制片厂制作传媒免费版樱花| 亚洲日韩在线中文字幕第一页| 学生妹亚洲一区二区| 日韩免费无码视频一区二区三区| 亚洲AV中文无码乱人伦| 亚洲男人天堂2018av| 成人最新午夜免费视频| 亚洲国产美国国产综合一区二区| 国产尤物在线视精品在亚洲| 免费成人福利视频| 亚洲中文无码永久免| 啊v在线免费观看| 三级黄色在线免费观看| 亚洲一区二区三区电影| 无人影院手机版在线观看免费| 亚洲电影免费观看| 午夜视频在线观看免费完整版| 亚洲av无码久久忘忧草| 1000部免费啪啪十八未年禁止观看 | 亚洲日韩av无码中文| 青青久在线视频免费观看| 亚洲无人区视频大全| 1000部拍拍拍18免费网站| 亚洲免费综合色在线视频| 亚洲午夜无码AV毛片久久|