题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-01-19 22:17:41

[单选题]请读程序:
#include <stdio.h>
#include <string.h>
Main()
{
Char *s1="AbCdEf", *s2="aB";
S1++; s2++;
Printf("%d\n",strcmp(s1,s2) );
}
上面程序的输出结果是()。
A.正数
B.负数
C.零
D.不确定的值

更多"[单选题]请读程序:#include &lt;stdio.h&gt;#"的相关试题:

[单选题]有以下程序
#include
#include
Void fun( char s[][10],int n)
{ char t; int i,j;
For(i=0;iFor(j=i+1;j/* 比较字符串的首字符大小,并交换字符串的首字符 */
If(s[i][0]>s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}
}
Main()
{ char ss[5][10]={"bcc","bbcc","xy","aaaacc","aabcc"};
Fun(ss,5); printf("%s,%s\n",ss[0],ss[4]);
}
程序的运行结果是()。
A.xy,aaaacc
B.aaaacc,xy
C.xcc,aabcc
D.acc,xabcc
[单选题]有以下程序,其中函数f的功能是将多个字符串按字典顺序排序
#include
Void f(char *p[],int n)
{ char *t; int i,j;
For(i=0;iFor(j=i+1;jIf(strcmp(p[i],p[j])>0){ t=p[i]; p[i]=p[j]; p[j]=t; }
}
Main()
{ char *p[5]={"abc","aabdfg","abbd","dcdbe","cd"};
F(p,5);
Printf("%d\n",strlen(p[1]));
}
程序运行后的输出结果是()。
A.2
B.3
C.6
D.4
[单选题]请读程序:
#include
Func(int
A, int b){
Int c;
C=a+b;
Return c;
}
Main( ) {
Int x=6,y=7,z=8,r;
R=func((x--,y++,x+y),z--);
Printf("%d\n", r);
}
上面程序的输出结果是()。
A.11
B.20
C.21
D.31
[单选题]请读程序:
#include
Main()
{
Int
A, b ;
For(a = 1 , b = 1 ; a <= 100 ; a++) {
If(b >= 20) break ;
If (b%3 == 1) { b += 3 ; continue ; }
B -= 5 ;
}
Printf("%d\n", a) ;
}
上面程序的输出结果是()。
A.7
B.8
C.9
D.10
[单选题]请读程序:
#include
Main()
{
Int num=0;
While( num <=2){
Num++; printf("%d\n",num);
}
}
上面程序的输出结果是()。
① 1 ② 1 ③ 1 ④ 1
2 2 2
3 3
4
A.①
B.②
C.③
D.④
[单选题]请读程序:
#include
Int a[ ]={2,4,6,8};
Main( )
{
Int i;
Int *p=a;
For( i=0;i<4;i++) a[i]=*p++;
Printf("%d\n",a[2]);
}
上面程序的输出结果是()。
A.6
B.8
C.4
D.2
[单选题]执行下列程序时输入123<空格>456<空格>789<回车> 输出结果是 ()。 main() { char s[100]; int c, i; scanf("%c",&c); scanf("%d",&i); scanf("%s",s); printf("%c,%d,%s\n",c,i,s); }
A.123456789
B.1456789
C.1,23,456,789
D.1,23,456
[单选题]下面程序
#include
#include
Main()
{ char *p1="abc",*p2="ABC",str[50]="xyz";
Strcpy(str+2,strcat(p1,p2) );
Printf("%s\n",str);
}
的输出是()。
A.xyzabcABC
B.zabcABC
C.yzabcABC
D.xyabcABC
[单选题]有以下程序
#include
#include
Int fun(int n)
{ int *p;
P=(int*)malloc(sizeof(int));
*p=n; return *p;
}
Main()
{ int a;
A=fun(10); printf("%d\n",a+fun(10));
}
程序的运行结果是()。
A.0
B.10
C.20
D.出错
[单选题]有以下程序
#include
#include
Typedef struct{ char name[9]; char sex; float score[2]; } STU;
Void f(STU a)
{ STU b={"Zhao",'m',85.0,90.0};
Int i;
Strcpy(a name,b.name);
A sex=b sex;
For(i=0;i<2;i++)
A score[i]=b score[i];
}
Main()
{ STU c={"Qian",'f',95.0,92.0};
F(c);
Printf("%s,%c,%2.0f,%2.0f\n",c.name,c.sex,c.score[0],c.score[1]);
}
程序的运行结果是()。
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,f,95,92
D.Zhao,m,85,90
[单选题]请选出以下程序的输出结果()。
#include
Sub(int x,int y,int *z)
{ *z=y-x;}
Main(){
Int
A,b,c;
Sub(10,5,&a);sub(7,a,&b);sub(a,b,&c);
Printf("%d,%d,%d\n",a,b,c);
}
A.5,2,3
B.-5,-12,-7
C.-5,-12,-17
D.5,-2,-7
[单选题]请选出以下程序段的输出结果()。
#include
#define MIN(x,y) (xMain()
{
Int i,j,k;
I=10;j=15;
K=10*MIN(i,j);
Printf("%d\n",k);
}
A.15
B.100
C.10
D.150
[单选题]下面程序
Main()
{
Int x=32;
Printf("%d\n",x=x<<1);
}
的输出是()。
A.100
B.160
C.320
D.64
[单选题]请读程序: main() { char *p; char s[80]; scanf("%s",s); p=s[0]; printf("%s",p); } 请判断上面程序选出正确答案是()。
A.错误:p=s[0]; 正确:p=*s;
B.错误:p=s[0]; 正确:p=s[];
C.错误:p=s[0]; 正确:p=s;
D.错误:p=s[0]; 正确:p=&s;
[单选题]下面的程序中()错误(每行程序前面的数字是行号)。
1 #include
2 main()
3 {
4 float a[3]={0.0};
5 int i;
6 for(i=0;i<3;i++) scanf("%d",a[i]);
7 for(i=1;i<3;i++)a[0]=a[0]+a[i];
8 printf("%f\n",a[0]);
9 }
A.没
B.第4行
C.第6行
D.第8行
[单选题]请读程序片段(字符串内没有空格字符):
Printf("%d\n",strlen("ATS\n012\1\\") );
上面程序片段的输出结果是()。
A.11
B.10
C.9
D.8
[单选题]请读程序片段(字符串内没有空格): printf("%d\n",strlen("ATS\n012\1\\"));的输出结果是()。
A.11
B.10
C.9
D.8

我来回答:

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

订单号:

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