怎么解决空格问题?help me!!!!!!!!!!!!!!
#include<fstream>
#include<iostream>
#include<string>
using namespace std;
int main()
{
ofstream outFile("copya.txt",ios_base::app);
if(!outFile)
{
cerr<<"can not open the file copya.txt!"<<endl;
return -1;
}
string aa;
while(cin>>aa)
{
if(aa=="0")
break;
outFile<<aa;
}
return 1;
}
怎么解决空格问题?
我输入如下:
string is here!!
yes,good!!
为什么文件输出却是stringishere!!yes,good!!