2869: 字符串最大跨距
摘要:解题思路:注意事项:(≖͞_≖̥)参考代码:#include<iostream>#include<algorithm>#include<string.h>#include<string>using n……
java--study||O.o
摘要:参考代码:import java.util.Scanner;
public class Main
{ public static void main(String[] args)
……
2869: 字符串最大跨距
摘要:解题思路:注意事项:参考代码:S, S1, S2 = map(str, input().split(","))
if S.find(S1) == -1 or S.find(S2) == -1:
……
字符串最大跨距(指针方法)
摘要:解题思路:使用strstr函数反复查找寻找到字符串最后出现的位置,最后利用指针相减的特性求出跨距。注意事项:注意录入数据时的格式;注意strstr查找不到字符串时会返回空指针(NULL);重复查找时注……
2869: 字符串最大跨距
摘要:解题思路:注意事项:参考代码:s,s1,s2 = input().strip().split(",")
if s1 in s and s2 in s:
a = s.index(s1)
……
字符串的函数和切片用的越来越熟练
摘要:解题思路:字符串反过来找到最近的注意事项:参考代码:l=list(input().split(','))ln=len(l[0])la=len(l[1])lb=len(l[2])if l……
2869: 字符串最大跨距
摘要:解题思路:注意事项:参考代码:l = list(input().strip().split(","))a = l[0].find(l[1])b = l[0].rfind(l[2])if a != -1……