Advertisement
gmmmarcos

Practico 3 - Funciones - ejercicio 1

Apr 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "pila.h"
  4.  
  5. int main()
  6. {
  7.  
  8. Pila DADA, MENOR, AUXDADA, AUXMENOR;
  9. inicpila (&DADA);
  10. inicpila (&MENOR);
  11. inicpila (&AUXDADA);
  12. inicpila (&AUXMENOR);
  13.  
  14. CargarPila (&DADA);
  15.  
  16. mostrar (&DADA)
  17.  
  18. return 0;
  19. }
  20.  
  21. void CargarPila (Pila* a)
  22. {
  23.  
  24. char OP='s';
  25. while (OP=='s')
  26. {
  27. // para ponerle nombre a la pila en el printf necesito strings //
  28. printf("INGRESE UN VALOR A LA PILA\n");
  29. leer (a);
  30. printf("\n DESEA INGRESAR OTRO? s/n\n");
  31. fflush(stdin);
  32. scanf("%c",&OP);
  33. }
  34. }
  35.  
  36. /* 1. Hacer una función que permita ingresar varios elementos a una Pila, tantos como quiera el usuario. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement