Programación S1
# incluir & ltstdio.h & gt
# incluir & ltstring.h & gt
# incluir & ltmalloc.h & gt
int search(char * strSource, char * strFind)
{
int find _ len = strlen(strFind);
int I = 0;
int bandera = 0;
mientras( *(strSource+i)!= '\0' ){
if(*(strSource+i) == *strFind){
if(strncmp(strSource+i,strFind,find_len){
flag++;
}
}
i++;
}
if (bandera!=0){
printf("-found[%d] veces-\n", bandera) ;
} En caso contrario {
printf("-no encontrado-\ n ");
}
Devuelve 0; p>
}
int main()
{
char strSource[100] = "Tres niños nadaron tres veces en tres días en el río tres veces .";
char strFind[10] = "tres";
search(strSource, strFind);
Devuelve 0;
}