Advertisement
Hardware

Exercício 8 - Strings

Nov 16th, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. main()
  5. {
  6.       char txt[50];
  7.       int n,i;
  8.       n=0;
  9.       printf("Digite uma frase qualquer:");
  10.       gets(txt);
  11.       for(i=0; txt[i] != '\0'; i++)
  12.       {
  13.                if(txt[i] == ' ')
  14.                          txt[i]='\n';
  15.       }
  16.       puts(txt);
  17.       system("Pause");
  18. }
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement