填空题 [说明] 编写程序,把从键盘上输入的一批整数(以-1作为终止输入的标志)保存到文本文件“a: xxk1. dat”中。
(1)
# include <fstream. h >
# include < stdlib. h >
void main ( )
(2)
if ( ! four)
cerr < <“文件没有找开!” < <end1;
exit (1);

int x;
cin > >x;
while( (3) )
(4)
cin> >x;

(5)


  • 1、
【正确答案】 1、{{*HTML*}}# include < iostream. h >
ofstream four(" a: xxk1, dat" );
x! = -1
fout < fout. close( );    
【答案解析】