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)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 尤溪县| 平陆县| 玛沁县| 连城县| 肇东市| 沁水县| 天全县| 南阳市| 屏边| 汝南县| 福贡县| 永川市| 邢台市| 太仆寺旗| 安阳县| 鹤庆县| 八宿县| 离岛区| 武安市| 乌海市| 阳泉市| 喀什市| 馆陶县| 个旧市| 确山县| 进贤县| 壶关县| 宁强县| 阿克苏市| 高阳县| 板桥市| 定安县| 靖江市| 泾阳县| 牡丹江市| 金堂县| 塔城市| 蛟河市| 禹城市| 金平| 博客|