题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-08-01 06:11:04

[填空题]下列程序的输出结果是______。
#include <iostream.h>
#include <cstring.h>
using namespace std;
void fun(const char*s,char &C) c=s[strlen (s)/2];
int main ) char str [] ="ABCDE";
char ch=str[1];
fun(str,sh);
cout<<Ch;
return 0;

更多"下列程序的输出结果是______。 #include <iostrea"的相关试题:

[单项选择]下面程序的输出结果是(  )。 #include   #include   voidmain()   {   charp1[10],p2[10];   strcpy(p1,"abc");   strcpy(p2,"ABC");   charstr[50]="xyz":   strcpy(str+2,strcat(p1,p2));   cout<  }
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[单项选择]如下程序的输出结果是 #include<iostream> #include<iomanip> using namespace std; class CSum{ int x,y; public: CSum(int x0,int y0):X(x0),y(y0){ } friend ostream& operator<<(ostream& os,const CSum& xA) { os<<setw(5)<<xa.x+xa.y: return os; } }; int main( ){ CSum y(3,5); cout<<setfill(’*’)<<8; cout<<y; return 0; }
A. 88
B. ****88
C. ****8****8
D. 8****8
[单项选择]如下程序的输出结果是 #include<lostream> #include<cstring> using namespace std; class XCD{ char*a; int b; public: XCD(char*aa,int bB) { a=new char[strlen(aA) +1]; strcpy(a,aA) ; b=bb; } char*Geta( ){return a;} int Getb( ){return b;} }; int main( ){ char*pl="abcd",*p2="weirong": int dl,6,d2=8; XCD x(pl,d1),y(p2,d2); cout<<strlen(x.Geta( ))+y.Getb( )<<endl; return 0; }
A. 12
B. 16
C. 14
D. 11
[单项选择]如下程序的输出结果是 #include<iostream> #include<cstring> using namespace std; class XCF{ int a; public: XCF(int aa=0):a(aA) {cout<<"1";} XCF(XCF&X){a=x.a;cout<<"2";l ~XCF( ){cout<<a;} int Geta( )t return a;} }; int main( ){ XCF d(15),d2(d1); XCF*pd=new XCF(8); cout<<pd->Geta( ); delete pd; return 0; }
A. 1215588
B. 1218855
C. 12185
D. 128512
[单项选择]下面程序的输出结果是(  )。   #include   Usingnamespacestd;   ClassBase{   public:   Base(intx=O){count<  }   };   ClassDerived:publicBase{   public:Derved(intx=0{count<  }   private;   Baseval;   };   intmina(){   Derivedd(1);   retrun0;   }
A. 0
B. 1
C. 01
D. 001
[填空题]下列程序输出结果是 【13】 。 include <iostream> using namespace std; template <typename T> T fun(T a, T b) {return (a<=b)a:b;} int main( ) { cout<<fun(3,6)<<’,’<<fim(3.14F, 6.28F)<<end 1; return 0; }
[填空题]下列程序输出结果是 【13】
include <iostream>
using namespace std;
template <typename T>
T fun(T a, T b) return (a<=b)a:b;
int main( )

cout<<fun(3,6)<<’,’<<fim(3.14F, 6.28F)<<end 1;
return 0;

[填空题]

以下程序运行后的输出结果是()。
#include
#include
#include
main( )
{ char *p;int i;
p=(char*)malloc(sizeof(char)*20);
strcpy(p,"welcome");
for(i=6;i>=0;i--) putchar(*(p+i));
printf("/n"); free(p);
}


[单项选择]下面程序的输出结果是
#include<iostream.h>
#include<string.h>
void main( )

char p1[10],p2[10]
strcpy(p1,"abc");
strcpy(p2,"ABC");
char str[50]="xyz";
strcpy(str+2,strcat(p1,p2));
cout<<str;

A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[填空题]以下程序的输出结果是 [9]
include<iostream.h>
include <string.h>
void main 0
char s[50];
strcpy(&s[O], "No" );
strcpy(&s[1], "123" );
strcpy (&s[2], "23456" );
cout<<s;

[填空题]下列程序的输出结果是 【8】 。 #include <iostream> #include <cstring> using namespace std; void fun(const char *s, char &c){c=s[strlen (s)/2];} int main( ) { char str[]="ABCDE"; char ch=str[1]; fun(str, ch); cout<<ch; return 0; }
[填空题]下列程序的输出结果是 【9】 。 #include<iostream> #include<cstring> using namespace std; void fun(const char*s,char &c) {c=s[strlen(s)/2];} int main( ) { char str[]="ABCDE"; char ch=str[1]; fun(str, ch); cout<<ch; return 0;
[单项选择]下面的程序输出结果是( )。
#include<iostream>
using namespace std;
void add( )

static int x;
x++;
cout<<x<<’’;

int main( )

for(int i=0;i<3;i++)
add( );
return 0;

A. 111
B. 123
C. 222
D. 333
[单项选择]如下程序的输出结果是
#include<iostream>
using namespace std;
class MyClass
public:
MyClass(int i=0)cout<<1;
MyClass(const MyClass&x)cout<<2;

int main( )
MyClass objl(1),obj2(2),ohj3(objl);
return 0;

A. 112
B. 111
C. 121
D. 113
[单项选择]下面程序输出的结果是( )。
#include<iostream>
using namespace std;
int fuc (char *x);
int main( )
cout<<fuc("hello")<<endl;
return 0;

int fuc(char *x)
char *y=x;
while(*y! =’/0’)y++;
return(y-x);

A. 5
B. 6
C. 0
D. 语法错误,不能输出结果

我来回答:

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

订单号:

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