题解 2861: 验证子串

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

解 2861: 验证子串

摘要:解题思路:注意事项:参考代码:a = input().strip()b = input().strip()if a.find(b) != -1:    print(f"{b} is substring……

验证子串(二种方法)

摘要:解题思路:注意事项:参考代码:第一种强行解题,硬解:#include<stdio.h> #include<string.h> int main() { char a[200]; char……

2861-验证子串

摘要:解题思路:实际上本题用到了数据结构的思想,采用最传统的暴力法,不断的比较注意事项:参考代码:int main(){ char s1[201]; char s2[201]; int len1……

2861: 验证子串

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <stdlib.h>#include <string.h>#define maxn 205char cmp(char……

c代码记录之验证字串

摘要:1.空串是所有字符串的子串,但这题好像不验证这个 2.gets不通过,scanf能通过 #include #include int main() { ……

长短比较确定正反。

摘要:解题思路:设定三个字符串,strm,strn,stra。其中stra是对长的字符串(strm或者strn)进行部分截取,再与短的字符串进行strcmp函数的比较。注意事项:参考代码:#include<……

2861: 验证子串(python)

摘要:解题思路:注意事项:参考代码:a = input().strip() # 注意把前导空格去掉 b = input().strip() if a in b:     print("%s is s……

验证字串C解

摘要:解题思路:注意事项:用gets只能过一部分,scanf能全过,也不知道为啥参考代码:#include<stdio.h>#include<string.h>int main(){    char s1[……

java--study||O.o

摘要:参考代码:import java.util.Scanner; public class Main  { public static void main(String[] args)     ……