下面程序执行后的输出结果是()。#includeenumTEST{A,B,C,D,E}ivoidmain(){inta[5]={10,20,30,40,50}i=Awhile(i<=E){printf("%4d",a[i])i=(enumTEST)((int)i+1)}printf("/n")}
A.1020
B.102030
C.10203040
D.1020304050
A.1020
B.102030
C.10203040
D.1020304050
若有以下程序: #include <iostream> using namespace std; class A { private: int a; public: void seta(int x) { a=x; } void showa() { cout<<a<<","; } }; class B { private: int b; public: void setb (int x) { b=x; } void showb() { cout<<b<<","; } }; class C :public A,private B { private: int c; public: void setc(int x, inc y, int z) { c=z; seta (x); setb (y); } void showc() { showa (); showb (); cout<<c<<end1; } }; int main () { C c; c. setc(1,2,3); c.showc(); return 0; } 程序执行后的输出结果是
A.1,2,3
B.1,1,1
C.2,2,2
D.3,3,3
(14)以下程序运行后的输出结果是 【14】 。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{ char *p; int i;
p=(char *)malloc(sizeof(char)*20);
strcpy(p,"welcome");
for(i=6;i>=0;i--) putchar(*(p+i));
printf("\n "); free(p);
}
执行下面程序后输出的正确结果是 Public class Test { public static void main(String args[]){ byte x=3,y=4; long r=80L; System.out.print(r/y); System.out.print(”,”); System.out.print(x/y); } }
A.20.0,1
B.20.0,1.0
C.20,0
D.20,1.0
A.20.0,1
B.20.0,1.0
C.20,0
D.20,1.0
执行下面程序后输出的正确结果是 public class Test{ public static void main(String args[]){ byte x=3,y=4; long r=80L; System.out.print(r/y); System.out.print(","); System.out.print(x/y); } }
A.20.0,1
B.20.0,1.0
C.20,0
D.20,1.0
执行下面程序后输出的正确结果是 public class Test{ public stoic void main (String args[]){ byte x=3, y=4; long r=80L; System.out.print(r/y); System.out.print(","); System.out.print(x/y); } }
A.20.0, 1
B.20.0, 1.0
C.20,0
D.20, 1.0
执行下面程序后输出的结果是()。 #include <iostream> using namespace std; int main(){ int a[4][4]={{1,2,3,-4},{7,-12,-13,8},{-21,9,0,-24},{-31,10,-33,11}}; int i,j,s=0; for(i=0;i<4;i++){ for(j=0;j<4;j++){ if(a[i][j]>=0)continue; s+=a[i][j]; } } coat<<s<<endl; return 0; }
A.141
B.-138
C.-1
D.75
在窗体上画一个命令按钮,然后编写如下程序:
Dim x As Integer
Sub inc(a As Integer)
x=x+a
End Sub
Private Sub Command1_Click()
inc 2
inc 3
inc 4
Msgbox x;
End Sub
程序执行后,单击Command1命令按钮,消息框显示结果是【 】。
下面程序的执行结果是()。 #include<iostream> using namespace std; class building { public: building() {} building(unsigned stories, float breadths, float lengths) { story = stories; breadth = breadths; length = lengths;} void getstory(void) { cout<<"story is:"<<story<<endl;} void getarea(void) { area = length*breadth*story;cout<<"area is:"<<area<<endl;} private: unsigned story; float length; float breadth; float area; }; void main(void) { building b1,b2;building b3(10u,16.6,58.8); b1.getstory(); b1.getarea(); b2.getstory(); b2.getarea(); b3.getstory(); b3.getarea();}
A.story is:0 area is:0 story is:0 area is:0 story is:10 area is:9760.8
B.story is:null area is:null story is:null area is:null story is:10 area is:9760.8
C.前两个对象输出的结果是不定的,后一个对象的结果正确
D.前两个对象没有初值,因此程序编译时出错