Pagini recente » Cod sursa (job #1776001) | football2 | Cod sursa (job #2579541) | Cod sursa (job #1672144) | Cod sursa (job #1911951)
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
ifstream in("strmatch.in");
ofstream out("strmatch.out");
string A,B;
vector<int> SOL;
void read(){
in>>A>>B;
}
void solve(){
int sol=0;
int poz=B.find(A,0);
while(poz!=-1){
sol++;
if(sol<=1000)SOL.push_back(poz);
poz=B.find(A,poz+1);
}
out<<sol<<"\n";
for(auto x : SOL)
out<<x<<" ";
}
int main(){
read();
solve();
return 0;
}