Advertisement
KlimexuS

Untitled

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