Cod sursa(job #2855407)
| Utilizator | Data | 22 februarie 2022 13:37:31 | |
|---|---|---|---|
| Problema | Abc2 | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin ("abc2.in");
int main()
{
int i=0,con=0,con2=0;
char s[1000000], v[50000][20],t[10000];
fin>>s;
while (fin){
fin>>v[i];
i++;
con++;
}
for(int i=0;i<con;i++){
strcpy(t,s);
while(strstr(s,v[i])!=0){
strcpy(s,strstr(s,v[i])+strlen(v[i]));
con2++;
}
}
cout<<con2;
}
