哈工大 C语言程序设计精髓 MOOC慕课 6-12周编程题答案 联系客服

发布时间 : 星期一 文章哈工大 C语言程序设计精髓 MOOC慕课 6-12周编程题答案更新完毕开始阅读

if (t

t=merged[i];

merged[i]=merged[k]; merged[k]=t; } }

for (i=0;i

printf(\ } return 0; }\11.3 \/*

题目内容:从键盘输入两个长度小于80的字符串A和B,且A的长度大于B的长度,编程判断B是不是A的子串,如果是,则输出”Yes”,否则输出”No”。这里所谓的该串的子串是指字符串中任意多个连续的字符组成的子序列。 函数原型:int IsSubString(char a[], char b[])

函数功能:判断b是否是a的子串,是则返回1,否则返回0

程序运行结果示例1:

Input the first string: Abcdefghijk123↙ Input the second string: 123↙ Yes

程序运行结果示例2: Input the first str: abefsfl↙ Input the second str: befs↙ Yes

程序运行结果示例3: Input the first str: aAbde↙ Input the second str: abc↙ No

输入第一个字符串的提示信息: \输入第二个字符串的提示信息: \输入单个字符的提示信息: \输入格式: 用 gets()函数 输出格式:

是子串,输出: \不是子串,输出: \*/

#include #include