题解 | #查找输入整数二进制中1的个数#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
//一次遍历
using namespace std;
int main(){
string str;
getline(cin, str);
string ans, pre;
for(int i = 0; i < str.size(); i ++ ){
if(isalpha(str[i])){
while(isalpha(str[i])){
pre += str[i];
i ++;
}
ans = pre + " " + ans;
pre = "";
}
}
cout<< ans << endl;
return 0;
}