Pagini recente » Cod sursa (job #3357768) | Cod sursa (job #3306355) | Cod sursa (job #3310019) | Cod sursa (job #3336013) | Cod sursa (job #3357754)
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
vector<int> pozit;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string A,B;
int off=0,poz,N=0,i;
f>>A>>B;
while(B.find(A,off)!=string::npos){
poz=B.find(A,off);
pozit.push_back(poz);
off=poz+1;
N++;
}
g<<N<<"\n";
for(auto i:pozit){
g<<i<<" ";
}
return 0;
}