Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // Lista de palavras aleatorias:
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. const char *aleatorias[] = {
  7. "ABC",
  8. "DEF",
  9. "GAG",
  10. "WAAH",
  11. "WEEE",
  12. "Coiso",
  13. "Bleh",
  14. "lalala",
  15. "oi",
  16. "weeee"
  17. };
  18.  
  19. const char *minhas_aleatorias[6] = {NULL,};
  20.  
  21. int main() {
  22. // Liga as palavras aleatorias ao seu vetor de seis palavras
  23. for (int i = 0; i < 6; i++) {
  24. minhas_aleatorias[i] = aleatorias[rand() % 10];
  25. }
  26.  
  27. // Imprime o resultado
  28. for (int i = 0; i < 6; i++) {
  29. printf("%s ", minhas_aleatorias[i]);
  30. }
  31. printf("\n");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement