lutxi14 de Febrero del 2006
PreguntaTengo que introducir una frase en mayusculas y luego solo dejar en mayusculas la primera letra de cada palabra :s
#include <stdio.h>
#include <conio.h>
main()
{
clrscr();
int i,k=0;
char PRI[30],A[30];
printf("\n Introduce una frase:");
gets(PRI);
for (i=0; i<30; i++)
{
if (PRI[i]!=\' \')
{
A[k]=PRI[i];
k++;
}
else
{
A[k]=PRI[i];
A[k]=\' \';
k++;
PRI[i++]=PRI[i++]+32;
A[k]=PRI[i];
k++;
}
}
puts(A);
getch();
}
#include <stdio.h>
#include <conio.h>
main()
{
clrscr();
int i,k=0;
char PRI[30],A[30];
printf("\n Introduce una frase:");
gets(PRI);
for (i=0; i<30; i++)
{
if (PRI[i]!=\' \')
{
A[k]=PRI[i];
k++;
}
else
{
A[k]=PRI[i];
A[k]=\' \';
k++;
PRI[i++]=PRI[i++]+32;
A[k]=PRI[i];
k++;
}
}
puts(A);
getch();
}
