Cod sursa(job #2484421)
Utilizator | Data | 31 octombrie 2019 08:58:05 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 2 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream fin("strmatch.in"); ofstream fout("strmatch.out");
string a, b;
int n;
int main(){
fin>>a>>b;
for(int i=0; i<b.length(); i++){
if(b[i]==a[0]){
for(int j=1; j<a.length(); j++){
if(a[j]!=b[i+j]){break;}
if(j=a.length()-1){n++;}
}
}
}
fout<<n;
return 0;
}