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

[填空题]函数strcmp( )的功能是对两个字符串进行比较,当s所指字符串和t所指字符串相等时,返回值为0; 当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp( ) ),请填空。   #include <stdio.h>   int strcmp ( chat * s, char * t)   { while( * s && * t && * s=【 】    { s++;t++; }    return【 】;   )

更多"函数strcmp( )的功能是对两个字符串进行比较,当s所指字符串和t"的相关试题:

[填空题]函数strcmp( )的功能是对两个字符串进行比较,当s所指字符串和t所指字符串相等时,返回值为0; 当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp( ) ),请填空。   #include <stdio.h>   int strcmp ( chat * s, char * t)   { while( * s && * t && * s=【 】    { s++;t++; }    return【 】;   )
[填空题]函数sstrcmp的功能是对两个字符串进行比较。当s所指字符串和t所指字符串相等时,返回值为0;当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp)。请填空。
#include <stdio.h>
int sstrcmp(char *s,char *t)
while(*s&&*t&& *s== 【15】 )
s++;t++;
return 【16】

[填空题]函数sstrcmp( )的功能是对两个字符串进行比较。当s所指字符串和t所指字符串相等时,返回值为0:当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串大于t所指字符串时,返回值大于0(功能等同于strcmp( ))。请填空。
int Sstrcmp(char *S,char *t)

while(*s&&*t&&*S==*t)

s++;
t++;

return 【7】 ;

[填空题]函数ssbc叩( )的功能是对两个字符申进行比较。当s所指字符串和t所指字符申相等时,返回值为0;当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp( ))。请填空。
#include <stdio.h>
int sstrcmp(char *s, char *t)

while(*s && *t && *s== )
s++;t++;
return

[填空题]下列给定程序中,函数fun( )的功能是:从s所指字符串中,找出t所指字符串的个数作为函数值返回。例如,当s所指字符串中的内容为abcdabfab,t所指字符串的内容为ab,则函数返回整数3。 请改正程序中的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构. 试题程序: #include <conio.h> #include <stdio.h> #include <string.h> int fun (char *s, char *t) {int n; char *p, *r; n=0; while(*s) {p=s; r=t; while (*r) /**************found**************/ if(*r==*p) {r++; p++} else break; /*************found**************/ if(r==’/0’) n++; s++; } return n; } main( ) {char s[100], t[100]; int m; clrscr( ); printf("/nPlease enter string s: "); scanf ("%s",s); printf("/nPlease enter substring t: "); scanf ("%s",t); m=fun (s,t); printf("/nThe result is: m=%d/n", m); }
[简答题]函数fun的功能是:将s所指字符串中下标为偶数同时ASCII值为奇数的字符删除,s所指串中剩余的字符形成的新串放在t所指的数组中。
注意:部分源程序给出如下。
请勿改动mam函数和其他函数中的任何内容,仅在函数fun的花括号中填入你编写的若干语句。
试题程序:
#include <stdio.h>
#include <string.h>
void fun(char *s, char t[])


main( )

char s[100], t[100];
printf("/nPlease enter string S:");
scanf("%s", s);
fun(s, t);
printf("/nThe result is:%s/n", t);

[填空题]下列给定程序中,函数fun( )的功能是:计算s所指字符串中含有t所指字符串的数目,并作为函数值返回。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include <conio.h>
#include <string.h>
#include <stdio.h>
#define N 80
int fun(char *s,char *t)
int n;
char *p, *r;
n=0;
while(*s)
p=s;
/**************found***************/
r=p;
while(*r)
if*r==*p) r++; p++;
else break;
/**************found***************/
if(*r==0)
n++;
s++;

return n;

main( )
char a[N],b[N]; int m;
clrscr( );
printf("/nPlease enter string a:");
gets(a);
printf("/nPlease enter substring b:");
gets(b);
m=funa,b);
printf("/nThe result is :m=%d/n",m);

我来回答:

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

订单号:

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