题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-22 06:44:24

[单项选择]在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。
#include <stdio.h>
main ( )
char ch;
while ((ch=getchar( ))!="/n")
if (ch>=’A’&& ch<=’B’)ch=ch+32;
else if (ch>=’a’&& ch<=’z’)ch=ch-32;
printf("%c",ch);

printf("/n");

A. ABCdef
B. abcDEF
C. abc
D. DEF

更多"在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为___"的相关试题:

[单项选择]以下程序运行后,如果从键盘上输入ABCDEF<回车>,则输出结果为______。
#include<stdio.h>
#include<string.h>
func(char str[])
int num=0;
while(*(str+num)!=’/0’) num++;
return(num);p

main( )
char str[10],*p=str;
gets(p);printf("%d/n",func(P));

A. 8
B. 7
C. 6
D. 5
[单项选择]若输入“abcdef”“abdef”,下述程序的输出结果为( )。
# include<stdio.h>
# include<string.h>
main( )
int n;
char s1[20] ,s2[20],*p1,*p2;
scanf("%s" ,s1);
scanf("%s" ,s2);
p1=s1;
p2=s2;
n=strcmp(p1,p2);
printf(”%d/n" ,n);

A. -1
B. 0
C. "abcdef"
D. "abdef"
[单项选择]若输入“abcdef”、“abdef”,以下程序的输出结果为( )。
#include<stdio.h>
#lnclude<string.h>
main( )
int n;
char s1[20],s2[20],p1,*p2;
scanf("%s",s1);
scanf("%s",s2);
P1=s1;
p2=s2;
n=strcmp(p1,p2);
printf("%d/n",n);
A. -1
B. 0
C. "abcdef"
D. "abdef"
[单项选择]两次执行下面的程序,如果从键盘上分别输入4和2,则输出结果是______。
main( )
int x;
scanf("%d/n",&x);
if(x++>3)printf("%d/n",x);
else printf("%d/n",x--);

A. 7和5
B. 5和3
C. 7和4
D. 6和4
[填空题]当执行cin语句时,从键盘上输入每个数据后必须输入一个______,然后才可以接着输入下一个数据。
[填空题]以下程序运行后输入“abcdef<回车>”,则输出结果是______。
#include<stdio.h>
#include<string.h>
void fun(char *str)
{ char temp; int n, i;
 n=strlen(str);
 temp=str[n-1];
 for(i=n-1; i>0; i--) str[i]=str[i-1];
 str[0]=temp;
}
main( )
{ char s[50];
  scanf("%s", s); fun(s); printf("%s/n", s);
}
[填空题]以下程序运行后输入:4,abcdef<回车>,则输出结果是______。 #include<stdio.h> #include<string.h> move(char*str,int n) { char temp;int i; temp=str[n-1]; for(i=n-1;i>0;i--) str[i]=str[i-1]; str[0]=temp; } main( ) { char s[50];int n,i,z; scanf("%d,%s",&n,s); z=strlen(s); for(i=1;i<n;i++) move(s,z); printf("%s/n",s); }
[填空题]下列程序运行时,若输入1abcdef2df<回车>,输出结果为______。
#include<stdio.h>
void main( )
char a=0,ch;
while((ch=getchar( ))!=’/n’)
if(a%2!=0&&(ch>=’a’&&ch<=’z’))ch=ch-’a’+’A’;
a++;putchar(ch);

printf("/n");

[填空题]下列程序执行时,从键盘上依次输入123和234,则程序的输出结果是 【10】 。 Dim a,b As Integer a=InputBox("请输入第一个整数") b=InputBox("请输入第二整数") Print a+b
[填空题]下列程序执行时,从键盘上依次输入123和234,则程序的输出结果是 【9】 。 a=InputBox("请输入第一个整数") b=InputBox("请输入第二整数") Print a+b
[单项选择]若执行下面的程序时,从键盘上输入5和2,则输出结果是
#include<iostream.h>
void main( )
int a,b,k;
cin>> a >> b;
k=a;
if(a<b)
k=a%b;
else
k=b%a;
cout<< k <<endl;
A. 5
B. 3
C. 2
D. 0
[单项选择]若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。
#include<stdio.h>
main( )
int a,b,s;
scanf("%d%d",&a,&b);
s=a;
if(a<b) s=b;
s=s*s;
printf("%d/n",s);

A. 1
B. 4
C. 2
D. 9
[单项选择]在键盘上,有的键标注了上下两个符号,如果要输入该键上边表示的符号应该( )。
A. 直接按该键
B. 同时按一F Shift:键和该键
C. 按一下Shift键,再按该键
D. 同时按一下Alt键和该键
[单项选择]若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。

#include<stdio.h>

main( )

int a,b,s;

scanf("%d%d",&a,&B) ;

S=a;

if(a<B) s=b;

s=s*s;

printtf("%d/n",s);


A. 1
B. 4
C. 2
D. 9

我来回答:

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

订单号:

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