2016-08-08 Problem Solving►UVa UVa 494 - Kindergarten Counting Game Contents 1. Problem2. Solution3. Code Problem中文網址 Solution處理符號和空白那些,記得每行最後一個單字也要算到。 CodeUVa 49412345678910111213141516171819202122232425262728293031323334353637#include<cstdio>#include<cctype>int main(){ char c; int count(0); bool flag(false); while ((c = getchar()) != EOF) { if (c == '\n') { if (flag) count++; printf("%d\n", count); count = 0; flag = false; continue; } if (isalpha(c)) { if (!flag) flag = true; } else if (flag) { count++; flag = false; } } return 0;} Newer UVa 11127 - Triple-Free Binary Strings Older UVa 10055 - Hashmat the Brave Warrior