#include <iostream>
using namespace std;
int main() {
int c;
cout << "enter a sentence" << endl;
while (c = cin.get() != EOF)
cout.put(c);
return 0;
}
可以接受空格
输入换行符结束。
#include <iostream>
using namespace std;
int main() {
int c;
cout << "enter a sentence" << endl;
while (c = cin.get() != EOF)
cout.put(c);
return 0;
}
可以接受空格
输入换行符结束。