搜题
已收录475621道考试试题
丨 最后更新:2026-01-23”“ 搜索结果
为您找到相关结果约475621个
下列程序的运行结果是( )
#include
#include
using namespace std;
class Point
{public:
Point(int X=0, int Y=0);
Point(Point &p);
int GetX() {return X;}
int GetY() {return Y;}
static int countP;
static void GetC(Point A,Point B)
{int z;
z=sqrt((B.X-A.X)*(B.X-A.X)+(B.Y-A.Y)*(B.Y-A.Y));
cout<X=X;this->Y=Y;
countP++;}
Point::Point(Point &p)
{ X=p.X; Y=p.Y; countP++;}
int Point::countP=0;
int main()
{ Point D(3,4),*p;
Point E(D);
p=&E;
void (*q)(Point,Point)=Point::GetC;
(*q)(D,E);
return 0;
}
查看更多
有以下程序段
char a = {{'a','b'},{'c','d'}};
char (*p) = a;
cout<<*(*(p+1));
p++;
cout<<*(*p+1)<
查看更多
有下列程序
using namespace std;
class SC
{public:
SC(int r){R =_____________;}
int Get(){return *R;};
private:
int *R; };
int main()
{ SC C(10);
cout <
查看更多
有以下类定义
using namespace std;
class B1{
int b1;
public:
B1(int i){b1=i; cout<
查看更多
有以下程序
#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 ( )
查看更多

Andriod下载
iPhone下载