对于代码 long int x (1.1);编译器不会报错
第1题:
有以下定义:“int a;long b;double X,Y;”,则以下选项中正确的表达式是( )。
A.a%(int x—y)
B.a=x!=Y;
C.(a*y)%b
D.y=x+y=X
第2题:
下列程序的运行结果是______。
include<stdio.h>
long func(int x)
{ long p;
if(x==O‖x==1)
return(1);
p=x*func(x-1);
return(p);
}
main()
{ printf("%d\n",func(4));
}
本题考查函数的循环调用。p=x*func(x-1),当x=4时,不满足if语句的条件,p=4*func(3), x=3也不满足条件,则func(3)=3*func(2),func(2)=2*func(1),x=1满足条件return(1),则输出结果为 4*3*2*1=24。
第3题:
运行以下的程序代码,结果是( )。 #include<iostream> using namespace std; intmain() { int x=5; int *q=&x; int &y=x; y++; tout<<(*q)++<<end1; return 0; }
A.5
B.6
C.7
D.8
第4题:
假设某个函数的原型为:void foo( int x, int y ); 该函数分别被C编译器和C++编译器编译后在符号库中的名字是什么?
第5题:
Given the following code, which method declarations, when inserted at the indicated position, will not cause the program to fail compilation?() public class Qdd1f { public long sum(long a, long b) { return a + b; } // insert new method declaration here }
第6题:
变量声明时不指定类型,编译器会报错误,编译不过去
第7题:
Java中整型包括()。
第8题:
Which of the following statements are legal?()
第9题:
protected int blipvert(long x) { return 0; }
protected long blipvert(int x) { return 0; }
private int blipvert(long x) { return 0; }
private int blipvert(int x) { return 0; }
public int blipvert(int x) { return 0; }
protected long blipvert(long x) { return 0; }
protected long blipvert(int x, int y) { return 0; }
第10题:
对
错
第11题:
1
2
3
4
第12题:
200
201
101
102
第13题:
在下列源代码文件Test.java中,正确定义类的代码是( )。
A.pblic class test { public int x=0; public test(int x) { this. x=x;} }
B.public class Test { public int x=0; public Test(int x) { this. x=x;} }
C.public class Test extends T1,T2{ public int x = 0; public Test(int x){ this. x = x; } }
D.protected class Test extends T2{ public int x = 0; public Test(int x) { this. x = x; } }
第14题:
有如下程序: #inClude<iostream> using namespaCe std; Class Sample{ friend long fun(Sample S); publiC: Sample(10ng A.{x=a;} private: long X; }; long fun(Sample S){ if(S.x<2)return l; return S.X*fun(Sample(s.x-1)); } int main( ) { int sum=0; for(int i=0;i<6;i++) {sum+=fun(Sample(i));} Cout<<sum: return 0; } 执行这个程序的输出结果是( )。
A.120
B.16
C.154
D.34
第15题:
A.byte, short, int, long, float, double
B.boolean, byte, short, char, int, long, float, double
C.byte, short, char, int, long, float, double
D.byte, short, char
E.int, long, float, double
第16题:
阅读以下代码: public class Test{ public static void main(){ System.out.println(“x=”+x); } } 请问,代码运行的结果是?()
第17题:
以下代码编译报错的是?()
第18题:
考虑下面的函数: int min(int x,int y){return x
第19题:
在C语言中(以16为PC机为例),5种基本数据类型的存储空间长度的排列顺序为()。
第20题:
public int sum(int a, int b) { return a + b; }
public int sum(long a, long b) { return 0; }
abstract int sum();
private long sum(long a, long b) { return a + b; }
public long sum(long a, int b) { return a + b; }
第21题:
第22题:
x
x=x
“x=”+5
编译报错
第23题:
2
3
4
0
1
第24题:
public int blipvert(int x) { return 0; }
private int blipvert(int x) { return 0; }
private int blipvert(long x) { return 0; }
protected long blipvert(int x, int y) { return 0; }
protected int blipvert(long x) { return 0; }
protected long blipvert(long x) { return 0; }
protected long blipvert(int x) { return 0; }