单选题
阅读以下程序
#include<iostream.h>
void main()
{
char line[10];
cin>>line;
cout<<line<<endl;
}
如运行时输入“This is an example.<CR>”,则程序的输出结果是______。
A、
This
B、
This is
C、
This is a
D、
This is an example
【正确答案】
A
【答案解析】
[解析] 本题考查C++中cin输入流对象的使用规则,其特点是以空格、回车和tab为分隔符。因此this和is之间的空格告诉cin对象停止接收后面的数据。故正确答案为A。
提交答案
关闭