题解 | 字符串包含
#include <iostream> using namespace std; int main() { string a, b; cin >> a >> b; int len_a = a.size(); int len_b = b.size(); if (len_a <= len_b) { if (b.find(a) != b.npos) { cout << 1 << endl; } else { cout << 0 << endl; } } else { if (a.find(b) != a.npos) { cout << 1 << endl; } else { cout << 0 << endl; } } } // 64 位输出请用 printf("%lld")