#include <stdio.h>
#include <stdlib.h>

//Questao 6 - Lista 4
//Caio Siqueira

void CamelCase (char *s){
    int tam = strlen(s), i, j=0;
    int novotam=tam;

    s[0]=s[0]+'A'-'a';
    for(i=1; i<tam; i++){
        if(s[i]==' '){
            s[i+1]=s[i+1]-32;
        }
    }
    for(i=0; i<tam; i++){
        if(s[i]==' '){
            for(j=i+1; j<tam; j++){
                s[j-1]=s[j];
            }
            novotam--;
        }
    }
    for(i=novotam; i<tam; i++){
        s[i]=' ';
    }
}

main(){
    int i;
    char frase[50];
    printf("Digite uma frase: ");
    gets(frase);
    CamelCase(frase);
    printf("\n%s", frase);
}
