#include <iostream>
#include <string>
using namespace std
;
void skipBlanks(istream
&is
)
{
while (is
.peek() == '\n' || is
.peek() == '\t' || is
.peek() == ' ')
is
.ignore();
}
int main()
{
char ch
;
string buf
;
while (!cin
.eof())
{
cin
.get(ch
);
skipBlanks(cin
);
buf
+= ch
;
}
cout
<< endl
;
cout
<< "You have input message:" << endl
;
cout
<< buf
<< ", size: " << buf
.length() << endl
;
return 0;
}
转载请注明原文地址: https://www.6miu.com/read-13488.html