http://poj.org/problem?id=3371
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include <iostream> 2 #include <iomanip> 3 #include <cstring> 4 using namespace std; 5 const int N=102; 6 bool is_sen(char ch)//判断是否为句子 7 { 8 if (ch=='.'||ch=='!'||ch=='?'||ch==':'||ch==';') 9 return true; 10 return false; 11 } 12 bool is_vowel(char ch)//判断是否是元音 13 { 14 if (ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='y') 15 return true; 16 return false; 17 } 18 int main() 19 { 20 char msg[N],world[N]; 21 int sen = 0,worlds = 0,syl = 0; 22 while(cin>>msg) 23 { 24 worlds++;//单词计数 25 int len = strlen(msg); 26 for(int i = 0; i < len; i++) 27 { 28 if (msg[i]>='A'&&msg[i]<='Z') 29 msg[i]=msg[i]-'A'+'a'; 30 else if (is_sen(msg[i])) 31 sen++;//句子计数 32 } 33 int l = len; 34 int s = 0,k = 0; 35 while(!(msg[l]>='a'&&msg[l]<='z')) --l; 36 while(!(msg[s]>='a'&&msg[s]<='z')) ++s; 37 for (int i = s; i <= l; i++) 38 { 39 world[k++] = msg[i]; 40 } 41 world[k]='