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

[简答题]下列给定程序中,函数fun的功能是:将tt所指字符串中的小写字母全部改为对应的大写字母,其他字符不变。
例如,若输入“Ab,CD”,则输出“AB,CD”。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
试题程序:
#lnclude<conio.h>
#include<stdio.h>
#include<string.h>
char*fun(char tt[])
(
int i;
for(i=O;tt[1];i++)
/******found******/
if((tt[i]>=’a’)||(tt[i]<=’z’))
/******found********/
tt[i]+=32;
return(tt);

main( )
char tt[81];
printf("/nPlease enter a string:");
gets(tt);
printf(/nThe result string is/n%s"fun(tt));

更多"下列给定程序中,函数fun的功能是:将tt所指字符串中的小写字母全部改"的相关试题:

[简答题]下列给定程序中函数fun的功能是:将tt所指字符串中的小写字母全部改为对应的大写字母,其他字符不变。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
试题程序:
#include <conio.h>
#include <stdio.h >
#include <string.h>
char* fun (char tt[])

int i;
for (i=0; tt[i]; i++)
/********** found********** /
if ((tt[i]>=’a’) ||(tt[i]<=’z’))
/********** found********** /
tt[i]+=32;
return (tt);

main ( )

char tt[81];
printf ("/nPlease enter a string: ");
gets (tt);
printf ("/nThe result string is:
/n% s", fun(tt));

[填空题]下列给定程序中,函数fun( )的作用是:将字符串tt中的小写字母都改为对应的大写字母,其他字符不变。例如,若输入“edS,dAd”,则输出“EDS,DAD”。
请改正程序中的错误,使它能得到正确结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include <stdio.h>
#include <string.h>
#include <conio.h>
/*************found*************/
char fun(char tt[ ])

int i;
for(i=0;tt[i];i++)

/*************found*************/
if((tt[i]>=’A’)&&(tt[i]<=’Z’))
tt[i]-=32;

return(tt);

main( )

int i;
char tt[81];
clrscr( );
printf("/nPlease enter a string:");
gets(tt);
printf("/nThe result string is:/n%s",fun(tt));

[填空题]下列给定程序中,函数fun( )的作用是,将字符串tt中的大写字母都改为对应的小写字母,其他字符不变。例如,若输入"Ab,cD",则输出"ab, cd"。
请改正函数fun( )中的错误,使它能得出正确的结果。
注童:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include <stdio.h>
#include <string.h>
#include <conio.h>
char *fun (char tt[])

int i;
for(i=0; tt[i]; i++)
/**************found**************/
if((’A’ <=tt[i]||(tt[i]<=’z’ ))
tt[i]+=32;
return(tt);

main( )
int i;
char tt[81];
clrscr( );
printf("/nPlease enter a string:");
gets(tt);
printf("/nThe result string is:/n %s",
fun(tt));

[填空题]请补充main函数,该函数的功能是:把一个字符串中的所有小写字母字符全部转换成大写字母字符,其他字符不变,结果保存原来的字符串中。
例如:当str[N]“123 abcdef ABCDEF!”,结果输出:
“123ABCDEFABCDEF!”。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#define N 80
void main( )

int j;
char str[N]="123abcdef ABCDEF!";
char *pf=str;
clrscr( );
printf("*** original string ***/n");
puts(str);
【1】
while(*(pf+j)).

if(*(pf+j)>=’a’&&* (pf+j)<=’z’)

*(pf+j)= 【2】
j++;

else
【3】

printf("****** new string ******/n");
puts(str);
system("pause");

[填空题]请补充函数fun( ),该函数的功能是将字符串tt中的大写字母都改为对应的小写字母,其他字符不变。例如,若输入“Are you come from Sichuan”,则输入“are you come from sichuan”。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<string.h>
#include<conio.h>
char *fun(char tt[])

int i;
for(i=0;tt[i];i++)

if((tt[i]>=’A’)&&( 【1】 ))
【2】 ;

return ( 【3】 ) ;
main( )

char tt[81];
printf("/nPlease enter a string:");
gets(tt);
printf("/nThe result string is: /n%s",
fun(tt));

[简答题]填空题 请补充main函数,该函数的功能是:把一个字符串中的所有小写字母字符全部转换成大写字母字符,其他字符不变,结果保存原来的字符串中。 例如:当str[N]=“123 abcdef ABCDEF!”,结果输出:“123 ABCDEF ABCDEF!”。 注意:部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。 试题程序: #include #include #include #define N 80 void main( ) { int j; char str[N]=" 123abcdef ABCDEF!"; char *pf=str; clrscr( ); printf("***original string ***/n"); puts(str); 【1】; while(*(pf+j)) { if(*(pf+j)>=’’a’’&&*(pf+j)<=’’z’’) { *(pf+j)=【2】; j++; } else 【3】; } printf("******new string******/n"); puts(str); system("pause"); }
[填空题]给定程序中,函数fun的功能是:求出形参ss所指字符串数组中最长字符串的长度,其余字符串左边用字符*补齐,使其与最长的字符串等长。字符串数组中共有M个字符串,且串长小于N。
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:部分源程序给出如下。
不得增行或删行,也不得更改程序的结构!
试题程序:
#include <stdio.h>
#include <string.h>
#defineM 5
#defineN 20
void fun (char (*ss)[N])
inti, j, k=0, n, m, len;
for(i=0; i<M; i++)
len=strlen(ss[i]);
if(i==0)n=len;
if (len>n)
/******************found*******************/
n=len; (1) =i;


for(i=0; i<M; i++)
if(if=k)
m=n;
len=strlen(ss[i]);
/******************found*******************/
for (j= (2) ; j>=0; j--)
ss[i][m--]=ss[i][j];
for (j=0; j<n-len; j++)
/******************found*******************/
(3) =’*’;


main( )
char ss[M][N]="shanghai", "guangzhou",
"beijing", "tianjin", "chongqing");
int i;
printf("/nThe original strings are:/n");
for(i=0; i<M; i++)
[填空题]在给定程序中,函数fun的功能是:求出形参SS所指字符串数组中最长字符串的长度,其余字符串左边用字符*补齐,使其与最长的字符串等长。字符串数组中共有M个字符串,且串长<N。
请在程序的下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更改程序的结构。
文件BLANK1.C内容如下:
#include<stdio.h>
#include<string.h>
#define M 5
#define N 20
void fun(char( *ss)[N])
int i,j,k=0,n,m,len;
for(i=0;i<M;i++)
len=strlen(ss[i]);
if(i==0)n=len:
if(len>n)
/**********found**********/
n=len;
(1) =i;


for(i=0;i<M;i++)
if(i!=k)
m=n:
len=strlen(ss[i]);
/***********found***********/
for(j= (2) ;j>=0;j--)ss[i][m--]=ss[i][j];
for(j=0;j<n-len;j++)
/**********found**********/
(3) =’*’:

void main( )
char ss[M][N]="shanghai","guangzhou","beijing","tianjing","cchongqing";
int i;
printf("/nThe original strings are: /n");
for(i=0;i<M;i++)printf("%s/n",ss[i]);
printf("/n");
fun(ss);
printf("/nThe resuh

我来回答:

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

订单号:

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