include iostream include string using namespace std int main int strin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>
using namespace std;
int main() {
int n,x,i=0,k=0;
string a;
string b;
getline(cin,a);
getline(cin,b);
i=a.find(b,i)+1;
while(i>0){
cout << i-1 << " ";
i=a.find(b,i)+1;
}
}