cadena en c++
me ayudan con este código en C + +, a la lista de todas las cantidades de las apariciones de cada palabra de un texto escrito en C + +
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char *args[])
{
char texto [5000], ptexto [5000];
int tam1, tam2, cont, i, rep[100];
fori=0;i<100;i++)
rep[i]=0;
cout << "n Por favor escriba un texto: n"; gets(texto);
tam1 = strlen(texto);
i = 0, cont = 0;
for (i = 0; i <= tam1; i++)
{
if ((texto[i]!=' ')&&( texto[i]!=' '))
{
ptexto[cont] = texto [i];
cont++;
}
else
ptexto[cont] = ' ';
cont = 0;
if (stricmp(ptexto, pteste) == 0)
rep[cont] = rep[cont] +1;
else
{
rep[cont] = 0;
}
}
tam2 = strlen (ptexto);
j=0;
for (i = 0; i <= tam2; i++)
{
if (rep [i]> 0)
{
cout << "n" <<ptexto[i] << "repetiu" <<rep [i] << "veces";
j= 1;
}
}
getchar();
return 0;
}
¿Qué debo hacer para ejecutar el código, me ayude he intentado todo, por favor ...
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char *args[])
{
char texto [5000], ptexto [5000];
int tam1, tam2, cont, i, rep[100];
fori=0;i<100;i++)
rep[i]=0;
cout << "n Por favor escriba un texto: n"; gets(texto);
tam1 = strlen(texto);
i = 0, cont = 0;
for (i = 0; i <= tam1; i++)
{
if ((texto[i]!=' ')&&( texto[i]!=' '))
{
ptexto[cont] = texto [i];
cont++;
}
else
ptexto[cont] = ' ';
cont = 0;
if (stricmp(ptexto, pteste) == 0)
rep[cont] = rep[cont] +1;
else
{
rep[cont] = 0;
}
}
tam2 = strlen (ptexto);
j=0;
for (i = 0; i <= tam2; i++)
{
if (rep [i]> 0)
{
cout << "n" <<ptexto[i] << "repetiu" <<rep [i] << "veces";
j= 1;
}
}
getchar();
return 0;
}
¿Qué debo hacer para ejecutar el código, me ayude he intentado todo, por favor ...