<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
    主站蜘蛛池模板: 日韩免费人妻AV无码专区蜜桃 | 久久水蜜桃亚洲AV无码精品| 免费污视频在线观看| 亚洲一级片内射网站在线观看| 亚洲变态另类一区二区三区| 精品久久免费视频| 亚洲av无码专区在线电影| 毛片免费视频播放| 亚洲熟妇AV日韩熟妇在线| 成人免费无码大片A毛片抽搐| 亚洲精品第一综合99久久| 最近免费中文字幕大全视频| 一区二区亚洲精品精华液| 午夜两性色视频免费网站| 国产天堂亚洲精品| 国产精品亚洲mnbav网站 | 国产香蕉九九久久精品免费| 亚洲国产乱码最新视频| 免费无码黄网站在线观看| 真正全免费视频a毛片| 亚洲一级片内射网站在线观看| 热99RE久久精品这里都是精品免费| 精品亚洲一区二区| 真实国产乱子伦精品免费| 国产精品亚洲精品观看不卡| 国产成人aaa在线视频免费观看 | 久久久久亚洲av无码专区导航| 久久国产色AV免费观看| 亚洲综合小说另类图片动图| 五月婷婷亚洲综合| 七色永久性tv网站免费看| 久久国产亚洲精品无码| 最近中文字幕无吗免费高清 | 色天使色婷婷在线影院亚洲| 亚洲高清国产拍精品青青草原 | 久久精品国产亚洲AV嫖农村妇女| 四虎在线成人免费网站| 亚洲av乱码中文一区二区三区| 日韩一卡2卡3卡4卡新区亚洲| 亚洲视频免费在线播放| 久久亚洲精品高潮综合色a片|