搜题
已收录475621道考试试题
丨 最后更新:2026-01-22”“ 搜索结果
为您找到相关结果约475621个
下面程序的输出结果是( )
#include
int main()
{
int i, n = 0;
float x = 1, y1 = 2.1 / 1.9, y2 = 1.9 / 2.1;
for ( i = 1; i < 22; i++)
x = x * y1;
while ( x != 1.0 )
{
x = x * y2; n++;
}
printf( "%d\n", n );
return 0;
}
查看更多
有以下程序
#include
using namespace std;
class A
{int *p,n;
public:
A():p(0),n(0){}
A(int q, int m)
{n=m;
p=__________;
for(int i=0;i
查看更多
有以下程序
#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<
查看更多
有以下程序
#include
using namespace std;
int main(){
int sum;
for(int i=0; i<6; i+=2)
{
sum=i;
for(int j = i; j<6; j++)
{if(i+j>5) continue;
sum+=j;}
}
cout<
查看更多
有以下程序
#include
using namespace std;
int a={1,2,3,4,5,6,7,8,9,0};
void fun(int *pa,int n);
int main()
{int m=10;
fun(a,m);
cout<0;i--)
*(pa+6)+=pa;
}
运行结果是( )
查看更多
有以下程序
#include
#include
using namespace std;
int main()
{ deque A;
for(int i=0;i<5;i++)
A.push_back(2*i+1);
while(___________)
{
cout << A.front() << " ";
A.pop_front();
}
cout << endl;}
程序的运行结果是1 3 5 7 9,请为横线处选择合适的程序( )
查看更多
有以下程序
#include
using namespace std;
double power (double x, int n)
{ double val = 1.0;
while (n--) val *= x;
return(val); }
int main()
{ int i;
int value = 0;
char ch;
for (i=7; i>=0; i--)
{ cin >> ch;
if (__________)
value += power(2,i);}
cout<
查看更多
有以下程序
#include
using namespace std;
class P{
char nameP;
public:
P(char *name="123"){strcpy(nameP,name);}
char*getName(){
return nameP;}
virtual char *getType(){
return "P";} };
class B:public P
{ char nameB;
public:
B(char*n1,char *n2):P(n1){strcpy(nameB,n2);}
char *getName(){return nameB;}
char*getType(){
return "B";} };
void showP(P *p){
cout<getType()<<":"<getName()<
查看更多
有以下程序,程序的功能是菜单选择:选择A输出:ADD;选择D输出:DELETE ;选择S输出:SORT;选择Q则退出。
#include
using namespace std;
int main()
{char choice;
while(________)
{
cout << "Menu: A(dd) D(elete) S(ort) Q(uit),Select one:";
cin >> choice;
if (choice == 'A')
{cout << "ADD" << endl;
continue;}
else if (choice == 'D')
{cout << "DELETE " << endl;
continue;}
else if (choice == 'S')
{cout << "SORT" << endl;
continue;}
else if (choice == 'Q')
break;
}
}
请为横线处选择合适的程序( )
查看更多
有以下程序
#include
using namespace std;
____________________
int main()
{int a=1,b=2,c=3;
cout<
查看更多

Andriod下载
iPhone下载