题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-03-26 06:34:57

[单项选择]若输入bcdefgh、m、abcdefg,以下程序的输出结果为( )。 #include<stdio.h> #include<string.h> main( ) { int i; char string[20],str[3][20]; for(i=0;i<3;i++)gets(str[i]); if(strcmp(str[0],str[1])>0) strcpy(string,str[0]); else strcpy(string,str[1]); if(strcmp(str[2],string)>0) strcpy(string,str[2]); printf("%s",string); }
A. bcdefgh
B. m
C. abcdefg
D. bcdefgh或abcdefg

更多"若输入bcdefgh、m、abcdefg,以下程序的输出结果为( )"的相关试题:

[单项选择]若输入bcdefgh、m、abcdefg,以下程序的输出结果为( )。
#include<stdio.h>
#include<string.h>
main( )
int i;
char string[20],str[3][20];
for(i=0;i<3;i++)gets(str[i]);
if(strcmp(str[0],str[1])>0)
strcpy(string,str[0]);
else strcpy(string,str[1]);
if(strcmp(str[2],string)>0)
strcpy(string,str[2]);
printf("%s",string);

A. bcdefgh
B. m
C. abcdefg
D. bcdefgh或abcdefg
[单项选择]若输入“abcdef”、“abdef”,以下程序的输出结果为( )。
#include<stdio.h>
#lnclude<string.h>
main( )
int n;
char s1[20],s2[20],p1,*p2;
scanf("%s",s1);
scanf("%s",s2);
P1=s1;
p2=s2;
n=strcmp(p1,p2);
printf("%d/n",n);
A. -1
B. 0
C. "abcdef"
D. "abdef"
[简答题]

给出下面程序的输出结果
#include < iostream >
using namespace std;
template < class T >
T F(T x)
{
return x > 5;
}
void main( )
{
int a = 15;
cout << F(a) << " /n";
double b = - 5.8976;
cout << F(b) << " /n";
cout << F(5) <<" /n";
}


[简答题]

给出下面程序的输出结果
#include < iostream >
using namespace std;
class A
{
private: int X, Y;
public : A ( int myx, int myy) { X = myx; Y = myy ;}
void show ( ) { cout << "X =" << X << " Y = " << Y << endl;}
};
class B : public A
{
private : int H, W;
public: B ( int myx, int myy, int myh, int myw) : A ( myx, myy) [ H = myh ; W = myw;}
void show ( ) { cout << "H = " << H << " ; W = " << W << endl; }
};
void main( )
{
B d(1,2,3,4) ;
d. show ( ) ;
}


[填空题]有以下程序;
#include
using namespaCe std;
int main( )
{
int i=010,j=10;
cout<<(++i)<<","< return 0;
)
则该程序运行后的输出结果是【6】
[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531,请填空。
#include
main( )
int n,s;
printf("Enter a number:"); scanf("%d",&n);
printf("Output: ");
do
s=n%10; printf("%d",s); ______;
while(n!=0);
printf("/n");

[单项选择]有如下程序: #include #include using namespace std; class MyString{ public; char str[80]; MyString(const char*s) {strcpy(str,s);} MyString&operator+=(MyString a){ strcat(str,a.str); return*this; } }; ostream&operator<<(ostream&s,const MyString&z){return s << z.str} int main( ){ MyString x("abc"),y("cde"); cout<<(x+=y)<A. abc
B. cde
C. abcde
D. abccde
[简答题]有如下程序 #include #include using namespace std; class MyClass{ public: MyClass( ){cout<<’A”;} MyClass(char c {cout<A. A.ABX
B.ABXB
C.AXB
D.AXBB

[单项选择]有如下程序 #include using namespace std; class Base{ protected: Base( ){cout<<′A′;} Base(char C){cout<A. B
B. BA
C. AB
D. BB
[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135,则输出531,请填空。
#include<stdio.h>
main( )
int n,s;
printf("Enter a number:");scanf("%d",&n);
printf("Output:");
do
s=n%10;printf("%d",s);______;
while(n!=0);
printf("/n");

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码