P9940 题解
FurippuWRY · · 题解
设两字符串分别为
可以从
#include<bits/stdc++.h>
using namespace std;
string a, b;
int i = 0, ans = 0;
int main() {
cin >> a >> b;
while (i <= b.size()) {
for (int j = 0; j <= a.size(); ++j) {
if (a[j] == b[i]) i++;
}
++ans;
}
cout << ans;
return 0;
}