过滤多余的空格:题解

C2023040 2023-12-16 19:23:41

#include<bits/stdc++.h> using namespace std; int main() { string s; int c=0; while(cin>>s) { c++; if(c==1) { cout<<s; } else { cout<<" "<<s; } } return 0; }