Cod sursa(job #3357754)

Utilizator Dariuscriss72Popescu Darius Mihai Dariuscriss72 Data 13 iunie 2026 13:51:02
Problema Potrivirea sirurilor Scor 40
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.45 kb
#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;
}