Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. void pokazTablice( int t[], int n )
  6. {
  7. for( int i = 0; i < n; ++i )
  8. cout << t[ i ] << " ";
  9. cout << endl;
  10. }
  11.  
  12. void wypelnij( int wzorzec, int t[], int n )
  13. {
  14. for( int i = 0; i < n; t[ i++ ] = wzorzec )
  15. ;
  16. }
  17.  
  18. void zeruj( int t[], int n )
  19. {
  20. wypelnij( 0, t, n );
  21. }
  22.  
  23.  
  24.  
  25. // Minimum
  26. // Maksimum
  27. // Suma
  28. // Średnia
  29.  
  30. int main()
  31. {
  32. const int N = 10;
  33.  
  34. int tab[ N ];// = { 0, 0, 0, 0, 0 };
  35.  
  36. //for( int i = 0; i < N; ++i )
  37. // tab[ i ] = 0;
  38.  
  39. zeruj( tab, N );
  40.  
  41. pokazTablice( tab, N );
  42.  
  43. cout << "\nRozmiar tablicy w bajtach: " << sizeof( tab );
  44. cout << "\nRozmiar tablicy w elementach: " << sizeof( tab ) / sizeof( tab[0] );
  45.  
  46. cin.get();
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement