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 藍冰飛寒 閱讀(128) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 涞源县| 滨州市| 九寨沟县| 汉阴县| 毕节市| 浦江县| 永吉县| 增城市| 伽师县| 香格里拉县| 汉寿县| 弥渡县| 陵川县| 广昌县| 方正县| 昌邑市| 怀宁县| 镇平县| 成武县| 绵阳市| 乐清市| 辛集市| 庆阳市| 金堂县| 黄浦区| 景洪市| 扶绥县| 四子王旗| 乌拉特后旗| 保定市| 武胜县| 环江| 阳江市| 泽普县| 石楼县| 宜春市| 河南省| 洪湖市| 成都市| 西峡县| 仁化县|