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]);
              }
              
            }*/

          }

          文章來源:http://www.tt-shopping.com/kevinlau/read.php/37.htm
          posted on 2009-04-13 12:18 藍冰飛寒 閱讀(906) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 临安市| 佛冈县| 那坡县| 五家渠市| 桓仁| 睢宁县| 林州市| 抚远县| 鱼台县| 环江| 宿迁市| 嘉禾县| 云阳县| 云南省| 彩票| 哈密市| 乃东县| 长寿区| 蕉岭县| 龙海市| 满洲里市| 张家口市| 温宿县| 虹口区| 孟连| 宜章县| 新和县| 黄浦区| 白朗县| 河间市| 宜都市| 喀什市| 徐州市| 鱼台县| 赤水市| 古浪县| 顺平县| 乐亭县| 五峰| 盐津县| 全州县|