已收录475621道考试试题

最后更新:2026-01-22

”“ 搜索结果

为您找到相关结果约475621

有以下程序 #include using namespace std; class Point {public: Point(float xx=0, float yy=0) {X=xx;Y=yy;} float GetX() {return X;} private: float X,Y;}; class Rectangle: private Point {public: Rectangle(float x, float y, float w, float h):Point(x,y) {W=w;H=h;} float GetX() {return ___________;} float GetH() {return H;} float GetW() {return W;} private: float W,H;}; int main() { Rectangle r(1,2,3,4); cout<
查看更多
以下程序的输出结果为( ) using namespace std; void print(char **str) { ++str; cout<<*str<
查看更多
以下程序的输出结果为( ) int main() { char *ptr; char arr = "12345678"; ptr = arr; ptr += 5; printf("%s",ptr); return 0; }
查看更多
执行如下代码后输出结果为( ) int main() { int a = {1, 2, 3, 4, 5}; int *ptr = (int*)(&a + 1); printf("%d, %d", *(a + 1), *(ptr - 1)); return; }
查看更多
下面程序输出结果为( ) #include int fun(int a) { int b=0; static int c=3; b++; c++; return (a+b+c); } int main( ) { int i=0; for(;i<3;i++) printf("%d",fun(2)); return 0; }
查看更多
有以下类定义 #include using namespace std; class Clock {public: Clock(int NewH=0, int NewM=0, int NewS=0) {Hour=NewH; Minute=NewM;Second=NewS;} void ShowTime() {cout<=60) { Second=Second-60; Minute++; if(Minute>=60) { Minute=Minute-60; Hour++; Hour=Hour%24;}} return ________;} int main() { Clock c1; (++c1).ShowTime(); return 0;} 请为横线处选择合适的程序使得程序的运行结果是0:0:1 ( )
查看更多
有下列类定义 #include using namespace std; class Point { public: Point(int a=3,int b=5){ X=a;Y=b;} int GetX(){return X;} int GetY(){return Y;} private: int X,Y;}; 现有语句Point *p=new Point;则与(*p).GetX()等效的表达式是( )
查看更多
print函数声明为void print(int a,char b='b',int c=1); 下面函数调用正确的是(      )
查看更多
有以下语句定义 int x =5; const int * const p = &x; const int &q=x; int const *next=&x; const int *j=&x; 则有语法错误的是( )
查看更多