Cod sursa(job #3249684)
Utilizator | Data | 17 octombrie 2024 16:09:22 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 80 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include<fstream>
using namespace std;
ifstream cin("strmatch.in");
ofstream cout("strmatch.out");
int s[2000001];
int main(){
int poz=0,aux=0;
string a,b;
cin>>a>>b;
while((poz=b.find(a,poz)+1)){
s[aux]=poz-1;aux++;
}cout<<aux<<"\n";
while(poz<aux && poz<1000){
cout<<s[poz]<<" ";
poz++;
}
return 0;
}