下面程序的运行结果如下:
This is line1
This is line2
This is line3
将下列程序补充完整,答案写在答题纸上。源程序如下:
#include ﹤iostream﹥
#include _________
using namespace std;
void main( )
{
fstream fin, fout;
fout.open("my.txt", ios:: out);
if(!fout.is_open( ))
return;
for(int i=0; i﹤3; i=i+1)
fout﹤﹤"This is line"﹤﹤i+1﹤﹤endl;
fout.close( );
fin.open("my.txt", ios:: in);
if(! fin.is_open( ))
return;
char str[100];
while(_________)
{
fin.getline(str,100);
cout﹤﹤str﹤﹤endl;
}
fin.close( );
}
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服