Advertisement
KlimexuS

Untitled

Jan 5th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define RozmiarTablicy 1000
  4.  
  5. struct struktura
  6. {
  7. int tab[RozmiarTablicy];
  8. int LiczbaElementow;
  9. int schowek[RozmiarTablicy];
  10. int LiczbaKopiowanych;
  11. }
  12. ;
  13.  
  14. void add(struct struktura* dodaj);
  15. void rew(struct struktura* odwroc);
  16.  
  17.  
  18.  
  19. int main()
  20. {
  21. char akcja[4];
  22. scanf ("%3s", akcja);
  23. while(1)
  24. {
  25. if(strcmp(akcja, "ext"==0))
  26. break;
  27. else if(strcmp(akcja, "add"==0))
  28. add(&lista);
  29. else if(strcmp(akcja, "sho"==0))
  30. }
  31.  
  32. struct struktura lista;
  33. lista.LiczbaElementow = 0;
  34. lista.LiczbaKopiowanych = 0;
  35.  
  36.  
  37. }
  38.  
  39. void add(struct struktura* dodaj)
  40. {
  41. scanf("%d", &(dodaj->tab[dodaj->LiczbaElementow]));
  42. dodaj->LiczbaElementow++;
  43. }
  44.  
  45. void rew(struct struktura* odwroc)
  46. {
  47. int a;
  48. int b;
  49. scanf("%d %d", a, b);
  50.  
  51. }
  52. void sho(struct struktura* pokaz)
  53. {
  54. int i=0;
  55. for(i=0; i<pokaz->LiczbaElementow; i++)
  56. {
  57. printf("%d, " ,pokaz->tab[i])
  58. }
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement