fork(2) download
  1. #include<stdio.h>
  2. #include<ctype.h>
  3.  
  4. void namechange(char abc[]) {
  5. for (int i = 0; abc[i] != '\0'; i++) {
  6. if (i == 0 || abc[i - 1] == ' ') {
  7. abc[i] = toupper(abc[i]);
  8. }
  9. }
  10. printf("%s", abc);
  11. }
  12.  
  13. int main() {
  14. char name[1000];
  15. scanf("%[^\n]s", name);
  16. namechange(name);
  17. }
Success #stdin #stdout 0s 9432KB
stdin
teste de upper na frase
stdout
Teste De Upper Na Frase