题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-18 02:32:10

[填空题]以下程序运行后的输出结果是【 】。    #include<iostream.h>    void fun(int x,int y)    { x=x+y;y=x-y;x=x-y;     cout<< x << "," <<y << " ,";=    void main( )    { int x=2,y=3;fun(x,y);      cout<< x << "," << y << endl;=

更多"以下程序运行后的输出结果是【 】。    #include<io"的相关试题:

[填空题]

以下程序运行后的输出结果是()。
#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<stdio.h>
#include<stdlib.h>
main( )
 int *a, *b, *c;
 a=b=c(int *) malloc(sizeof(int));
 *a=1; *b=2; *c=3;
 a=b;
 printf("%d, %d, %d/n", *a, *b, *c);

A. 3,3,3
B. 2,2,3
C. 1,2,3
D. 1,1,3
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
#include<string.h>
void fun(char *s[],int n)
char *t;int i,j;
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(strlen(s[i])>strlen(s[j]))t=s[i];s[i]=s[j];s[j]=t;

main( )
char *ss[]="bcc","bbcc","xy","aaaacc","aabce";
fun(ss,5);printf("%s,%s/n",ss[0],ss[4]);

A. xy,aaaace
B. aaaacc,xy
C. bcc,aabcc
D. aabcc,bcc
[填空题]以下程序运行后的输出结果是 【10】
#include <iostream>
#include <string>
using namespace std;
class Y;
class X

int x;
char *strx;
public:
x(int a,char *str)

x=a;
strx=new char[strlen(str)+1];
strcpy(strx,str);

void show(Y &oB) ;
;
class Y

private:
int y;
char *stry;
public:
Y(int b,char *str)

y=b;
stry=new char[strlen(str)+1];
strcpy(stry, str);

friend void X::show(Y &oB) ;
;
void X::show(Y &oB)

cout<<strx<<",";
cout<<ob.stry<<end1;

int main( )

X a(10,"stringX");
Y b(20,"stringY");
a.show(B) ;
return 0;

[填空题]以下程序运行后的输出结果是 【10】 #include <iostream> #include <string> using namespace std; class Y; class X { int x; char *strx; public: x(int a,char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y &oB) ; }; class Y { private: int y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+1]; strcpy(stry, str); } friend void X::show(Y &oB) ; }; void X::show(Y &oB) { cout<<strx<<","; cout<<ob.stry<<end1; } int main( ) { X a(10,"stringX"); Y b(20,"stringY"); a.show(B) ; return 0; }
[填空题]以下程序运行后的输出结果是 【17】
#include <stdio, h>
#include <string, h>
main( )
char ch[] ="abc".,x[3] [4]: int i:
for(i=0;i<3:i ++) strcpy(x[i] ,ch):
for(i =0;i<3:i++) printf( "% s" ,&x[i] [i]);
printf(" /n" )

[填空题]以下程序运行后的输出结果是 【16】
#include <stdio, h>
#include <stating, h>
void fun(char * s,int p,int k)
int i;
for(i=p;i<k-1;i++) s[i] =s[i+2];main( )
char s [] = "abedefg";
fun(s,3 ,strlen(s) ); puts(s);

[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
main( )
FILE * fp;int a[10]=1,2,3,i,n;
fp=fopen("d1.dat","w");
for(i=0;i<3;i++) fprintf(fp,"%d",a[i]);
fprintf(fp,"/n");
fclose(fp);
fp=fopen("d1.dat","r");
fscanf(fp,"%d",&n);
fclose(fp);
printf("%d/n",n);

A. 12300
B. 123
C. 1
D. 321
[填空题]以下程序运行后的输出结果是
#include <stdio, h>
main( )
int a=3,b=4,c=5,t=99;
if(b<a && a<c) t=a;a=c;c=t;
if(a<e && b<c) t=b;b=a;a=t;
printf( "%d %d %d //n" ,a,b,e);

[填空题]以下程序运行后的输出结果是【 】。 #include<string.h> main( ) {char ch[]="abc",x[3][4];int i; for(i=0;i<3;1++)strcpy(x[i],ch); for(i=0;i<3;i++)printf("%s",&x[i][i]; printf("/n"); }
[填空题]以下程序运行后的输出结果是【 】。    #include<iostream.h>    void fun(int x,int y)    { x=x+y;y=x-y;x=x-y;     cout<< x << "," <<y << " ,";=    void main( )    { int x=2,y=3;fun(x,y);      cout<< x << "," << y << endl;=

我来回答:

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

订单号:

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