更多"下面程序的功能是将从键盘输入的一对数,由小到大排序输出,当输入一对相等"的相关试题:
[单项选择]下面程序的功能是将从键盘输入的一对数,由小到大排序输出,当输入一对相等数时结束循环,在划线处应填入的选项是
#include<iosweam.h>
void main( )
int a,b,t;
cin >>a >>b;
while(___)
if(a>b)
t=a;a=b;b=t;
cout << a << " " << b << endl;
cin >> a >>b;
A. ! a=b
B. a!=b
C. a==b
D. a=b
[单项选择]下面程序的功能是将从键盘输入的两个数由小到大排序输出,当输入一对相等数时结束循环。请选择填空。
#include <stdio.h>
main( )
int a,b,t;
scanf("%d%d",&a,&b);
while(______)
if(a>b) t=a;a=b;b=t;
printf("%d,%d/n",a,b);
scanf("%d%d",&a,&b);
A. ! a=b
B. a! =b
C. a= =b
D. a=b
[单项选择]在下列程序的划线处应填入的语句是 ( )
class Person
private int a;
public class Man extends Person
public int b
public static void main(String arg[])
Person P=new Person( );
Man t=new Man( );
int i;
______
A. i=w;
B. i=b;
C. i=p.a;
D. i=t,b;
[单项选择]在下列程序的划线处应填入的语句是( )。 class Person private int a: public class Man extends Person public int b; public static void main(String arg []) Person p=newPerson( ); Man t=new Man( ); int i; _________________
A. i=w;
B. i=b;
C. i=P.a;
D. i=t.b;
[单项选择]在下列程序的划线处应填入的语句是
class Person
private int a;public class Man extends Person
public int b;
public static void main (String arg [])
Person p=new Person( );
Man t=new Man( );
int i:
A. i=w;
B. i=b
C. i=p.a;
D. i=t.b;
[简答题]下面程序的功能是把316表示为两个加数的和,使两个加数分别能被13和11整除,在划线处应填入的选项是
#include <iostream.h>
void main( )
int i=0,j,k;
doi++;k=316-13*i;while(______);
j=k/11;
cout<<"316=13*"<<i<<"+11*"<<j;
[单项选择]在下面的类定义中,横线处应填入的内容是
class Fred
public:
void print ( ) cout<<data<<end1;
void setData (double D) data=d;
static int count;
private:
double data;
;
______count=0; //静态数据成员的定义
A. int
B. static int
C. int Fred::
D. static int Fred::
[单项选择]从供选择的答案中,选出应填入下面叙述中______内的最确切的解答,把相应编号写在答卷的对应栏内。计算机网络中对等实体间通信时必须遵循约定的标准协议。不同的协议有不同的功能,如:
(1) :用于网络管理;
(2) :用于移动电话无线上网;
(3) :可用于家庭拨号上网;
(4) :一种面向比特的数据链路通信规程;
(5) :一种路由选择协议。
(1)
A. SNMP
B. PPP
C. RIP
D. WAP
[单项选择]在下面的定义语句中,画线处应填入的内容是
class Fred
public:
void print( )cout<<data<<endl;
void setData(double D) data=d;
static int count;
private:
double data;
;
______count=0;//静态数据成员的定义
A. int
B. static int
C. int Fred::
D. static int Fred::
[单项选择]在下面附属类方法中的下划线处应填入的正确参数是【 】
public void writeData( )throws IOException
{ GregorianCalendar calendar=new GregorianCalendar( );
calendar,setTime(hireDay);
out.println(name+"|"
+salary+"|"
+calendar.get(Calendar.YEAR)+"|"
+(calendar.get(Calendar.MONTH)+1)+"|"
+calendar.get(Calendar.DAY_OF_MONTH)):
}
A. Employee[]e
B. "employee.dat"
C. PrintWriter out
D. BufferedWriter