题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-05-14 22:31:13

[填空题]下列程序的输出结果是 [10]
#include<iostream.h>
#include<string.h>
void main( )
char b[30];
strcpy(&b[0],"XY");
strcpy(&b[1],"YZW");
strcpy(&b[2],"ZXY");
cout<<b<<end1;

更多"下列程序的输出结果是 [10] 。 #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
[填空题]下列程序输出结果是 【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);
}


[填空题]以下程序的输出结果是 [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; }
[单项选择]下面的程序输出结果是( )。
#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 A
public:
A( )cout<<"A";

class Bpublic:B( )cout<<"B";;
class C://public A
B b;
public:
C( )cout<<"C";

int main( )C obj;return 0;
A. CBA
B. BAC
C. ACB
D. ABC
[单项选择]下列程序的输出结果是
#include"iostream"
using namespace std;
int Max(int a,int b)

if(a>b)
return a;
else
return b;

void main( )

int m,n;
m=10,n=5;
int max = Max(m,n);
cout<<max<<endl;

A. 10
B. 程序有误
C. 1
D. 0
[单项选择]下列程序的输出结果是
#include <iostream>
using namespace std;
int main ( )

char a[] = "Hello,World":
char*ptr = a;
while (*ptr)

if(*ptr>= ’a’ &&*ptr <=’z’
cout<<char*ptr+’A’-’a’);
else cout<<*ptr;
ptr++;

return 0;

A. HELLO. WORLD
B. Hello, World
C. hELLO, wORLD
D. hello, world
[单项选择]下面程序的输出结果是
#include<iostream.h>
#include<string.h>
voidmain( )

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

A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[单项选择]下面程序的输出结果是( )。 #include<iostream> #include<math.h> using namespace std; class point { private: double x; double y; public: point(double a,double b) { x=a; y=b; } friend double distances(point a,point b); }; double distances(point a,point b) { return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } int main( ) { point p1(1,2); point p2(5,2); cout<<distances(p1,p2)<<end1; return 0; }
A. 2
B. 4
C. 8
D. 16

我来回答:

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

订单号:

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