跳到正文

算法·理论

验证子串

sunyuxuanqq约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年3月11日
收录
2025年12月12日
更新
2026年11月15日
篇幅
约 1 分钟

版本

  1. v1当前

#include <bits/stdc++.h>

using namespace std;

string s, t;

int main(){

C++
cin >> s >> t;
if((int)s.find(t)!=-1){
	cout << t << " is substring of " << s;
} else if((int)t.find(s)!=-1){
	cout << s << " is substring of " << t;
} else {
	cout << "No substring";
}
return 0;

}

原文