Está en la página 1de 2

#include <stdio.

h>
#include <string.h>
int main()
{
int a,b,c,i,j=0,k=0,h=0,l=0,p=0,y=0;
char ingreso[100], mat[100][100],mat1[100][100];
printf("Ingrese una cadena separado por punto y como(;): ");
gets(ingreso);
a=strlen(ingreso);
for (i=0;i<a;i++)
{
if (ingreso[i]==';' || ingreso[i]=='.')
{
j++;
p=-1;
k++;
h++;
y=0;
l++;
}
else
{
mat[j][p]=ingreso[i];

if(ingreso[i]==' ')
{
k++;
l++;
y=0;
}
else
{
mat1[k][y]=ingreso[i];
y++;
}
}
p++;
}
int aux=0;
int q;
for (i=0;i<h;i++)
{
for (c=(i+1);c<h;c++)
{
q=strcmp((mat[i]),(mat[c]));
if (q==0)
{

aux++;
}
}
}
printf("Frases que se repiten %i\n",aux);
aux=0;
for (i=0;i<l;i++)
{
for (c=(i+1);c<l;c++)
{
q=strcmp((mat[i]),(mat[c]));
if (q==0)
{
aux++;
}
}
}
printf("Palabras que se repiten %i\n",aux);

return 0;
}

También podría gustarte