更多"阅读以下程序# include<fstream. h>void mai"的相关试题:
[单项选择]阅读以下程序
#include<iostream.h>
void main( )
char line[10];
cin>>line;
cout<<line<<endl;
如运行时输入This is example.<CR>,则程序的输出结果是
A. This
B. This is
C. This is a
D. This is an example.
[单项选择]阅读以下程序
#include<fstream.h>
void main( )
{
ifstream infile;
ofstream outfile;
fstream iofile;
iofile.open("a.txt",ios::in);
iofile.close( );
iofile.open("b.txt",ios::out);
}
下列描述错误的是
A. 对象infile只能用于文件输入操作
B. 对象outfile只能用于文件输出操作
C. 对象iofile在文件关闭后,不能再打开另一个文件
D. 对象iofile可以打开一个文件同时进行输入和输出
[单项选择]阅读以下程序
#include<iostream.h>
void main( )
{
char line[10];
cin>>line;
cout<<line<<endl;
}
如运行时输入This is example.<CR>,则程序的输出结果是
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]阅读以下程序 #include<iostream.h> void main( ) { charline[10]; in>>line; cout<<line<<endl; } 如运行时输入This is an example.<CR>,则程序的输出结果是( )。
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]若有以下程序段: void x(int n); void main( ) { void x(int n); x(5); } void x(int n){ cout<<n: } 则以下叙述不正确的是 ______。
A. 若只在子函数中对函数x进行声明,则只能在主数中正确调用函数x
B. 若只在子函数前面对函数x进行声明,则其后的所有函数中都可以正确调用函数x
C. 对于以上程序,编译时系统会提示出错信息:提示对x函数重复声明
D. 函数x无返回值,所以可用void定义x的函数类型
[单项选择]
阅读下面程序
pubic class Cycle{
public static void main(String args[]){
System. out. println(args[0]);
在命令行中输入java Cycle one two,该程序输出结果是()
A. Cycle
B. one
C. two
D. 上述A、B、C、均不对
[单项选择]有以下程序
#include<iostream.h>
void main( )
{ int a=5,b=0,c=0;
if(a=b+c) cout<<"* * *" <<endl;
else cout<<"$$$"<<endl;}
下列选项叙述正确的是( )。
A. 有语法错不能通过编译
B. 可以通过编译但不能通过连接
C. 输出* * *
D. 输出 $ $ $
[单项选择]有以下程序
#include"iostream.h"
void main( )
int i=1,j=1,k=2;
if( (j++||k++)&&i++)
cout < < i < < "," < < j < < "," < < k;
cout< <end1;
执行后输出结果是
A. 1,1,2
B. 2,2,1
C. 2,2,2
D. 2,2,3