Cod sursa(job #1915818)
Utilizator | Data | 8 martie 2017 22:37:31 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 14 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include<bits/stdc++.h>
using namespace std;int x,p=-1,i;vector<int>s;string a,b,z="strmatch.";int main(){ifstream f(z+"in");ofstream g(z+"out");f>>a>>b;for(;p=b.find(a,p+1)+1;)x++,s.push_back(p);g<<x<<'\n';for(;i<x&i<1000;)g<<s[i++]<<' ';}