BlogJava 聯系 聚合 管理  

          Blog Stats

          News

           

          藍冰飛寒個人獨立博客地址,www.uphenan.com

          隨筆檔案

          文章檔案


          藍冰飛寒

          用心去做每一件事情

          /**
             * 【程序7】
          *題目:輸入一行字符,分別統計出其中英文字母、空格、數字和其它字符的個數。
          *1.程序分析:利用while語句,條件為輸入的字符不為 '\n '.
             */
          import java.io.*;
          public class BianliQiushu {
            public int k;
            public static void main(String[] args) {
              //BianliQiushu g=new BianliQiushu();
              System.out.println("Please Input^^^^^");
              tongji();
              

            }
            public static  void tongji(){
              //int n=100;
              
              BufferedReader input =new BufferedReader(new InputStreamReader(System.in));
              try {
                
                String s=input.readLine();
            char[] shuru=s.toCharArray();
                     int k=0;
                for(int i=0;i      System.out.print(shuru[i]);
                if((int)(shuru[i])!=13) k++;
                }
                System.out.println();
                System.out.println(k);
                
              } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
              }
              //while()
              
            }
            /**public void shuRu(){
              String[] a= new String[100];
              for(int i=0;i<=99;i++){
                try {
                  a[i]=System.in.read();
                } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
                }
                System.out.println(a[i]);
              }
              
            }*/

          }
          posted on 2009-04-13 12:18 藍冰飛寒 閱讀(130) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 湖北省| 新乐市| 广东省| 交城县| 贡嘎县| 宁化县| 紫阳县| 海盐县| 婺源县| 岳阳市| 靖宇县| 安吉县| 洞头县| 福鼎市| 辽宁省| 寻乌县| 南丰县| 松阳县| 奉新县| 缙云县| 阜城县| 昭平县| 武夷山市| 霍林郭勒市| 开封县| 长乐市| 岗巴县| 凤台县| 同德县| 阿坝县| 克什克腾旗| 绵阳市| 五寨县| 绿春县| 健康| 宜兰市| 吉林省| 望奎县| 宜阳县| 宁明县| 潜江市|