题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-07-27 05:36:59

[单项选择]有下列程序:
#include <stdio.h>
#include "string.h"
void tim(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","aabcc";
fun(ss,5);printf("%s,%s/n",ss[0],ss[4]);

程序的运行结果是( )。
A. xy,aaaacc
B. aaaacc,xy
C. bcc,aabcc
D. aabcc,bcc

更多"有下列程序: #include <stdio.h> #includ"的相关试题:

[单项选择]有下列程序: #include <stdio.h> #include "string.h" void tim(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","aabcc"}; fun(ss,5);printf("%s,%s/n",ss[0],ss[4]); } 程序的运行结果是( )。
A. xy,aaaacc
B. aaaacc,xy
C. bcc,aabcc
D. aabcc,bcc
[单项选择]有以下程序:
#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", "aabcc";
fun(ss, 5);
printf("%s, %s/n", ss[0], ss[4]);

程序的运行结果是
A. xy, aaaacc
B. aaaacc, xy
C. bcc, aabcc
D. aabcc, bcc
[填空题]

以下程序运行时输出到屏冪的结果中第一行是(),第二行是()。
#include
#include
Void compute(char*s)
{int t,r,
Char op;
For(r=0;isdigit(*s);s++) /*isdigit(*s)判断S指向的字符是否为数字字符*/
R=r*10+*s-‘0’;
While(*s)
{op=*s++;
For(t=0;isdigit(*s);s++)
T=t*10+*s-‘0’;
Switch(op)
{case’+’:r=r+t;break;
Case’-’:r=r-t;break;
Case’*’:r=r*t;break;
Case’/’:if(t)r=r/t;
else{puts(devide enor);return;}
}
}
Printf(%d/n,r);
}
Void main( )
{
compute(12+6-19+2);
Compute(12/6*19/2);
}


[单项选择]若有以下程序: #include<iostream> usingnamespacestd; voidsub(intx,inty,int*2) { *z=y+x; } int main( ) { int a,b,C; sub(8,4,&A) ; sub(6,a,&B) ; sub(a,b,&C) ; cout<<a<<","<<b<<","<<c<<end1; return 0; } 程序运行后的输出结果是
A. 12,18,30
B. -12,6,8
C. 6,8,10
D. 12,-18,16
[单项选择]有如下程序
#include<stdio.h>
main( )
int v1=0,v2=0;
char ch;
while((ch=getchar( ))!=’#’)
switch(ch)
case ’a’;
casff ’h’;
default:v1++;
case ’0’;v2++;

printf("%d,%d/n",v1,v2);

如果从键盘上输入china#<回车>,则程序运行结果为 ( )
A. 2,0
B. 5,0
C. 5,5
D. 2,5
[填空题]以下程序的输出结果是(  )。 #include #include #include mian( ) { char *p, *q, *r; p=q=r=(char *)malloc(sizeof(char)*20); strcpy(p,”attaboy,welcome!”); printf(“%c%c%c/n”,p[11], q[3], r[4]); free(p); }
[填空题]以下程序的输出结果是 【14】 。     #include<iostream.h>     void main( )     { int a=0;      a+ =(a=8);      cout < < a;     }
[单项选择]有以下程序 #include #include typedef struct {char name[9]; char sex; int score[2]; } STU; STU f(STU a) { STU b={"Zhao",’m’,85,90}; int i; strcpy(a.name,b.name); a.sex=b.sex; for(i=0;i<2;i++) a.score[i]=b. score[i]; return a; } main( ) { STU c={"Qian",’f’,95,92}, d; d=f(c); printf("%s,%c,%d,%d,",d.name, d.sex, d.score[0], d.score[1]); printf("%s,%c,%d,%d/n",c.name, c.sex, c.score[0], c.score[1]); } 程序运行后的输出结果是_______。
A. Zhao,m,85,90,Qian,f,95,92
B. Zhao,m,85,90, Zhao,m,85,90
C. Qian,f,95,92, Qian,f,95,92
D. Qian,f,95,92, Zhao,m,85,90
[填空题]以下程序运行后的输出结果是【 】。    #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 <stdio.h>
void f(int v, int w)
int t;
t=v; v=w; w=t;

main( )
int x=1,y=3,z=2;
if(x>y) f(x,y);
else if(y>z) f(y,z);
else f(x,z);
printf("%d,%d,%d/n",x,y,z);

执行后的输出结果( )。
A. 1,2,3
B. 3,1,2
C. 1,3,2
D. 2,3,1

我来回答:

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

订单号:

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