练习5.21
1 #include <iostream> 2 #include <string> 3 #include <cstring> 4 #include <vector> 5 using namespace std; 6 int main() 7 { 8 vector<string> str; 9 string str1; 10 while (cin >> str1) 11 { 12 auto last = str.end(); 13 if (str.size() != 0 && str1 == (*(last-1)) && isupper(str1[0])) 14 { 15 cout << str1 << endl; 16 break; 17 } 18 else 19 str.push_back(str1); 20 } 21 system("pause"); 22 return 0; 23 }
时间: 2024-08-01 06:29:57