uva494

#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <iostream>
#include <sstream>


using namespace std;


char s[120];
int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);


    while(gets(s)){
        for(int i = 0; i < strlen(s); i++){
            if(!isalpha(s[i])){s[i] = ' ';}
        }
        stringstream ss;
        string s1;
        int count = 0;
        ss<<s;
        while(ss>>s1) count++;
        printf("%d\n", count);
    }
return 0;
}
發佈了100 篇原創文章 · 獲贊 8 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章