未分类题

有如下的程序:
include <iostream>
include <fstream>
using namespace std;
int main()
{
ofstream outf('D://temp.txt',ios_base::trunc) ;
outf<<'World Wide Web';
outf.close();
ifstream inf('D://temp.txt');
char s[20];
inf>>s;
inf.close();
cout<<s;
return 0;
}
执行后的输出结果是【 】。

A.txt',ios_base::trunc)
B.close();
C.txt');
D.close();


【参考答案】

World
World 解析:提取运算符>>在读取数据时遇到空格、Tab符号以及回车符时将结束此次相关操作。