Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
77821 sh25_wangtaojie 验证子串 C++ 解答错误 0 MS 256 KB 527 2025-12-26 14:51:44

Tests(1/3):


#include <iostream> #include <string> using namespace std; bool isSubstring(const string& s1, const string& s2) { return s2.find(s1) != string::npos; } int main() { string s1, s2; cin >> s1 >> s2; if (isSubstring(s1, s2)) { cout << "(" << s1 << ") is substring of (" << s2 << ")" << endl; } else if (isSubstring(s2, s1)) { cout << "(" << s2 << ") is substring of (" << s1 << ")" << endl; } else { cout << "No substring" << endl; } return 0; }


测评信息: