Colección de citas famosas - Slogan de motivación - Según el diccionario, lenguaje c
Según el diccionario, lenguaje c
# incluir & ltstdio.h & gt
# incluir & ltstring.h & gt
int main()
{
char ch[100][100];
char c;
char temp[100][100];
int i=0, j = 0;
/*Separar palabras en toda la oración*/
while ((c = getchar()) = '\n''
{ p >
Si (c!=' ')
{
ch[I][j]= c;
j++;
}
Otro
{
ch[I][j]='\ 0';
j = 0 ;
i++;
}
}
ch[I][j]='\ 0';
/*orden lexicográfico*/
for(int k = 0; k & lt= I; k++)
{
for( int m = k+1; m & lt= I; m++)
{
if (strcmp(ch[k], ch[m])>0)
{
strcpy(temp[I], ch[k]);
strcpy(ch[k], ch[m]);
strcpy(ch[m], temp[I]);
}
}
}
/* Muestra el formato organizado palabras*/
for (int k = 0; k & lt= I; k++)
printf ("% s\n", ch[k]) ;
}