题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-14 20:03:47

[单项选择]若输入“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"

更多"若输入“abcdef”、“abdef”,以下程序的输出结果为( )。"的相关试题:

[填空题]下列程序运行时,若输入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");

[单项选择]若输入bcdefgh、m、abcdefg,以下程序的输出结果为( )。 #include<stdio.h> #include<string.h> main( ) { int i; char string[20],str[3][20]; for(i=0;i<3;i++)gets(str[i]); if(strcmp(str[0],str[1])>0) strcpy(string,str[0]); else strcpy(string,str[1]); if(strcmp(str[2],string)>0) strcpy(string,str[2]); printf("%s",string); }
A. bcdefgh
B. m
C. abcdefg
D. bcdefgh或abcdefg
[填空题]以下程序运行后输入: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); }
[单项选择]以下程序运行后,如果从键盘上输入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<回车>,则输出为______。
#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
[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。
#include <stdio.h>
main( )
int n,s;
printf("Enter a number:");scanf("%d",&n);
printf("Output:");
do
s=n%10;printf("%d",s);______;
while(n! =0);
printf("/n");

[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。 #include <stdio.h> main( ) { int n,s; printf("Enter a number:");scanf("%d",&n); printf("Output:"); do { s=n%10;printf("%d",s);______; }while(n! =0); printf("/n"); }
[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。 #include main( ) { int n,s; prinff("Enter a number:");scanf("%d",&n); printf("output: "); do { S=n%10;printf("%d",s).【 】;} while(n!=O); printf("\n"); }
[填空题]以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531,请填空。
#include
main( )
int n,s;
printf("Enter a number:"); scanf("%d",&n);
printf("Output: ");
do
s=n%10; printf("%d",s); ______;
while(n!=0);
printf("/n");

[填空题]以下程序运行后输入“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);
}
[填空题]下列程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。
#include<stdio.h>
main( )
int n,s;
printf("Enter a number:");scanf("%d",&n);
printf("Output:");do
s=n%10;printf("%d",s); ______;
while(n!=0);printf("/n");

[单项选择]8位D/A转换器,当输入数字量10000000时输出电压为5V,若输入为10001000,输出电压为()V。
A. 5.44
B. 5.76
C. 6.25
D. 6.84
[简答题]下列给定程序中函数fun的功能是:计算正整数num各位上的数字之积。
例如,若输入252,则输出应该是20。若输入202,则输出应该是0。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
试题程序:
#include <stdio.h>
#include <conio.h>
long fun(long mum)

/********** found********** /
long k;
do

k*=num% 10;
/********** found********** /
num/=10;
while(mum);
return(k);

main( )

long n;
printf("/n please enter a number: ");
scanf("%ld", &n);
printf("/n% ld/n", fun(n));

我来回答:

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

订单号:

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