BlogJava 聯(lián)系 聚合 管理  

          Blog Stats

          News

           

          藍(lán)冰飛寒個(gè)人獨(dú)立博客地址,www.uphenan.com

          隨筆檔案

          文章檔案


          藍(lán)冰飛寒

          用心去做每一件事情

          /**
             * 【程序7】
          *題目:輸入一行字符,分別統(tǒng)計(jì)出其中英文字母、空格、數(shù)字和其它字符的個(gè)數(shù)。
          *1.程序分析:利用while語(yǔ)句,條件為輸入的字符不為 '\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 藍(lán)冰飛寒 閱讀(906) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 靖州| 临汾市| 伊金霍洛旗| 和政县| 北流市| 南安市| 昌黎县| 莱阳市| 新津县| 丰镇市| 克什克腾旗| 都兰县| 晋中市| 射阳县| 宜春市| 萍乡市| 海安县| 寿宁县| 黔江区| 聊城市| 武夷山市| 苏州市| 宽城| 榆林市| 嘉禾县| 鄂托克前旗| 行唐县| 元谋县| 南宁市| 盱眙县| 宜川县| 凤台县| 忻城县| 大兴区| 城口县| 盐池县| 关岭| 汨罗市| 蒲江县| 城固县| 敦煌市|