A.Y
B.N
C.NG
第1题
下面程序的运行结果为 【10】 。
#include(iostream. h>
void fun(int x=0,int y=0)
{
cout<<
}
void main()
{
fun(5);
}
第2题
下面程序的运行结果为_____。
include<iostream.h>
void fun(int x=0,int y=0)
{
cout < < x < < y;
}
void main()
{
fun(5) ;
}
第3题
下面程序运行后的输出结果为() class A{ public int y=6; void showy(){ System.out.println("y="+y); } } class testA{ public static void main(String aaa []){ A a1 = new A(); A b1 = new A(); a1.y++; b1.showy(); } } 输出结果选择:
A、y=6
B、程序运行出错
C、y=8
D、y=7
第4题
下面程序的运行结果是()。 include<stdio.h> define P0WER(x) ((x)*(x)) void main() { int i=1; while(i<=4) { printf("%d\t",P0WER(i++)); } printf("\n"); }
A.2 3
B.5 7
C.1 9
D.2 12
第5题
下面程序的运行结果为()。 #include<iostream.h> void main { for(int a=0,x=0;!xa<=10;a++) { a++: } cout<<a<<endl: }
A.10
B.1l
C.12
D.0
第6题
下面程序的运行结果为()。 #include <iostream> using namespace std; void main() { for(int a =0,x =0; !x&&a < =10; a ++ ); cout << a << endl;
A.0
B.1
C.10
D.11
第7题
下面程序的运行结果为 #include<iostream.h> void main() { for(int a=0,x=0;! x&&a<=10;a++) { a++; } cout<<a<<end1; }
A.10
B.11
C.12
D.0
第8题
若下面程序运行时输出结果为
1,A,10.1
2,B,3.5
include <iostream>
using namespace std;
int main()
{
void test(int, char, doubie【 】);
test(1, 'A', 10.1 );
test(2, 'B');
return 0;
}
void test(int a, char b, double c)
{
cout<<a<<','<<b<<','<<c<<endl;
}
第9题
下面程序的运行结果为【 】。
class A
} public:
int num;
A(int i){num=i;}
A(A &a){num=++a.num;}
void print(){cout<<num;}
};
void main(){
A a(1),b(a);
a.print();
b.print();
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!