C++筆記:習題 6.20
/* C++ Primer 習題 6.20
* By Ceeji
*/
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s, s1;
s1 = "";
while (cin >> s)
{
if (s == s1)
{
cout << "Same: " << s << endl;
break;
}
s1 = s;
}
if (s != s1)
cout << "No Same words." << endl;
}
© 轉載需附帶本文連結,依 CC BY-NC-SA 4.0 釋出。