?import java.util.Scanner;class Blank {?public static void main(String[] args) {??// TODO Auto-generated method stubScanner B=new Scanner(System.in);String str=B.nextLine();int p=0;int i=0;while(B.hasNext()&&!str.equals("EOF")){?for(i=0;i<str.length();i++){??if(str.charAt(i)==' ')???++p;?}?str=B.nextLine();}System.out.println(p);?}}
關(guān)于統(tǒng)計輸入內(nèi)容的空格數(shù)?這能不能實現(xiàn)?
weibo_雨中漫步丶凝望雨殤_0
2015-06-09 20:18:52