31 lines
433 B
C++
31 lines
433 B
C++
#include <bits/stdc++.h>
|
|
#define endl '\n'
|
|
using namespace std;
|
|
|
|
string s;
|
|
|
|
|
|
int main(){
|
|
getline(cin, s);
|
|
|
|
string kg = "";
|
|
int l = 0, r = 0;
|
|
|
|
while(true){
|
|
kg = kg + ' ';
|
|
if(s.find(kg, l) == string::npos){
|
|
// 如果没有找到
|
|
r = s.size() - 1;
|
|
cout << s.substr(l, r - l) << endl;
|
|
break;
|
|
} else {
|
|
// 找到了
|
|
r = s.find(kg, l);
|
|
cout << s.substr(l, r - l) << endl;
|
|
l = r + kg.size();
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|