文件名称:设计strstr函数
介绍说明--下载内容来自于网络,使用问题请自行百度
描述
C语言中有一个函数strstr。我们编写一个类似功能的函数,mystrstr
int mystrstr(char a[], char b[]);
作用是查找字符串a中出现的第一个b串的下标,如果没有找到,返回-1。
输入
分别输入两个字符串a,b,分别占一行。字符串长度不超过500个字符。
输出
字符串a中出现的第一个b串的下标。
样例
输入
abca
a
输出
0(describe
There is a function strstr in C language. We write a similar function, mystrstr
int mystrstr(char a[], char b[]);
The function is to find the subscr ipt of the first B string in string a, and if it is not found, return - 1.
input
Input two strings a and B respectively, occupying one line. The string length does not exceed 500 characters.
output
The subscr ipt of the first B string that appears in string a.
Example
input
ABCA
A
output
Zero)
C语言中有一个函数strstr。我们编写一个类似功能的函数,mystrstr
int mystrstr(char a[], char b[]);
作用是查找字符串a中出现的第一个b串的下标,如果没有找到,返回-1。
输入
分别输入两个字符串a,b,分别占一行。字符串长度不超过500个字符。
输出
字符串a中出现的第一个b串的下标。
样例
输入
abca
a
输出
0(describe
There is a function strstr in C language. We write a similar function, mystrstr
int mystrstr(char a[], char b[]);
The function is to find the subscr ipt of the first B string in string a, and if it is not found, return - 1.
input
Input two strings a and B respectively, occupying one line. The string length does not exceed 500 characters.
output
The subscr ipt of the first B string that appears in string a.
Example
input
ABCA
A
output
Zero)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
| 文件名 | 大小 | 更新时间 |
|---|---|---|
| 设计strstr函数\描述.txt | 431 | 2019-11-03 |
| 设计strstr函数\设计strstr函数.c | 1719 | 2019-11-03 |
| 设计strstr函数 | 0 | 2019-11-03 |
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
