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

          Blog Stats

          News

           

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

          隨筆檔案

          文章檔案


          藍冰飛寒

          用心去做每一件事情

          /**
             * 【程序7】
          *題目:輸入一行字符,分別統(tǒng)計出其中英文字母、空格、數(shù)字和其它字符的個數(shù)。
          *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)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 忻州市| 全南县| 太仆寺旗| 彭水| 泾阳县| 句容市| 易门县| 五原县| 苍梧县| 五寨县| 海城市| 山阴县| 亳州市| 安溪县| 竹溪县| 康定县| 昆明市| 永定县| 平顺县| 波密县| 巴东县| 常山县| 大埔区| 揭西县| 怀远县| 焉耆| 承德市| 福海县| 铜山县| 湟中县| 德安县| 大英县| 长治县| 沈丘县| 互助| 大名县| 漠河县| 通许县| 德江县| 富平县| 大厂|