题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-07-25 03:38:18

[单项选择]下面程序的输出结果是( )。
#include<stdio.h>
#include<string.h>
main( )
char pl[20]="123 ", *p2="ABC ", str[50]="xyz";
strcpy(str+2, strcat(p1, p2) );
printf("%s/n", str);
A. xyzabzac
B. bAcBACBC
C. xy123ABC
D. yz123ABC

更多"下面程序的输出结果是( )。 #include<stdio.h> "的相关试题:

[单项选择]下面程序的输出结果是( )。
#include<stdio.h>
#include<string.h>
main( )
char p1[]="WHO",p2[]="who",str[50]="xyz";
strcpy(str+1,strcat(p1,p2));
printf("%s",str);
A. xyzWHOwho
B. zWHOwho
C. zWHOwho
D. xWHOwho
[单项选择]下列程序的输出结果是( )。
#include<stdio.h>
#include<string.h>
main( )
char a[]="/n123//";
printf("%d,%d/n",strlen(a),sizeof(a));

A. 5,6
B. 5,5
C. 6,6
D. 6,5
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
#include<string.h>
main( )
 char x[]="STRING";
 x[0]=0; x[1]='/0'; x[2]='0';
 printf("%d%d/n", sizeof(x),strlen(x));

A. 6 1 B) 7 0 C) 6 3 D) 7 1
[单项选择]下述程序的运行结果是( )。
#include<stdio.h>
#include<string.h>
main( )
char*s1="abDuj";
char*s2="ABdUG":
int t;
t=strcmp(s1,s2);
printf("%d",t);

A. 正数
B. 负数
C. 零
D. 不确定的值
[填空题]设有下列程序: #include<stdio.h> #include<string.h> main( ) { int i; char si 10],ti 10]; gets(t); for(i=0;i<2;i++) { gets(s); if(strcmp(t,s)<0)strcpy(t,s); } printf("%s/n",t); } 程序运行后,从键盘上输入(<CR>代表回车符):CDEF<CR>BADEF<CR>QTHRG<CR>,则程序的输出结果是______。
[简答题]完成下面类中成员函数的定义。
#include<iostream>
#include<string>
using namespace std;
class str
private:
char*st;
public:
str(char*a)
set(a);
str&operator=(______)
delete st;
set(a.st);
return*this;

void show( )cout<<st<<endl;
~str( )delete st;
void set(char*s)//初始化st
______
strcpy(st,s);


void main( )
str s1("he"),s2("she");
s1.show( ),s2.show( );
s2=s1;
s1.show( ),s2.show( );

[单项选择]下面程序输出的结果是什么 ( )
public class Quiz2

public static void main(String args[])

try throw new MyException( );
catch(Exception e)

System.out.println("It’s caught!");
finally
System.out.println("It’s finally caught!");



class MyExeeption extends Exception
A. It’s finally caught!
B. It’s caught!
C. It’s caught!/It’sfinally caught!
D. 无输出
[单项选择]下面程序输出的结果是( )。
#include <iostream>
using namespace std;
void swap(int &a,int &b)
int temp;
temp=a;
a=b;
b=temp;

void main( )
int x=2;
int y=3;
swap(x,y);
cout<<x<<y;

A. 23
B. 32
C. ab
D. ba
[单项选择]下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main( ){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A. 12.5
B. 7.5
C. 6.25
D. 25
[填空题]下面程序输出的结果是 【11】
#include <iostream>
using namespacc std;
class A
public:
void show( )tout<<"A!";
;
class B: public A
public:
virtual void show( )cout<<"B!";
;
class C: public B
public:
virtual void show( )cout<<"C!";
;
void show_info(A *i)i->show( );
void main( )
A ia;B ib;C ic;show_info(&i
  • a); show_info(&i
  • b);show_info(&i
  • c);

[填空题]下面程序输出的结果是 【10】
#include <iostream>
using namespace std;
class A
public:
virtual void show( ) cout<<"A!";
;
class B: public A
public:
void show( ) cout << "B!";
;
class C: public B
public:
void show( )cout << "C!";
;
void show_info(A &i) i. show( );
void main( )
A ia; B ib; C ic; show_info(i
  • a);show_info(i
  • b); show_info(i
  • c);

我来回答:

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

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码