提交时间:2022-03-19 10:57:27

运行 ID: 47046

#include<bits/stdc++.h> using namespace std; int main() { string s,a; int c; string::size_type p; while(cin>>c>>a>>s) { int n=s.size(); for(int i=0; i<n;) { p=s.find(a,i); if(p!=s.npos) { printf("%d\n",p); i=p+1; } else { cout<<endl; break; } } } return 0; }