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