未知题型
以下程序执行后输出的结果是【 】。
include<iostream>
include<fstream>
using namespace std;
int main(){
ofstream ofile('D://temp.txt');
if(!ofile){
cout<<'temp.txt cannot open'<<endl;
return 0;
}
ofile<<'This is a book' <<' ' <<54321<<endl;
ofilE.close();
ifstream ifile('D://temp.txt');
if(!ifile){
cout<<'temp.txt cannot open' <<endl;
return 0;
}
charstr[40];
ifile >> str;
ifilE.close();
cout<<Str<<endl;
return 1;
}
A.txt');B.txt
C.close();
D.txt');
E.txt
F.close();
【参考答案】
This
This 解析:程序中利用对象ofile在文件temp.txt中写入“This is a book 5......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
点击查看答案
相关考题
