Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. void wypelnij_tablice(int* tablica)
  8. {
  9.     for(int i = 0; i < 10; ++i)
  10.         tablica[i] = rand() % 100 + 1;
  11. }
  12.  
  13. void wypisz_tablice(int* tablica)
  14. {
  15.     for(int i = 0; i < 10; ++i)
  16.         cout << tablica[i] << "\t";
  17.     cout << endl;
  18. }
  19.  
  20. void sortuj(int* tablica)
  21. {
  22.     // kod do wypełnienia
  23. }
  24.  
  25. int main()
  26. {
  27.     srand(static_cast<unsigned>(time(nullptr)));
  28.     int tablica[10];
  29.     wypelnij_tablice(tablica);
  30.     wypisz_tablice(tablica);
  31.     sortuj(tablica);
  32.     wypisz_tablice(tablica);
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement