grodek118

Untitled

Sep 7th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int wylosujLiczby(int tablica[], int ile)
  9. {
  10. srand(time(NULL));
  11. for(int indeks = 0; indeks < ile; indeks++)
  12. {
  13. cout << "Indeks " << (indeks + 1) << " ma wartosc " << ((rand() % 30) + 10) << endl;
  14. }
  15. }
  16.  
  17. int wypisanieTablicy(int tablica[], int ile)
  18. {
  19. wylosujLiczby;
  20. }
  21.  
  22. int wypisanieOdTylu(int tablica[], int ile)
  23. {
  24. for(int indeks = 9; indeks > ile; indeks--)
  25. {
  26. wylosujLiczby;
  27. }
  28.  
  29. }
  30.  
  31. int main()
  32. {
  33. int tablica[10];
  34. wylosujLiczby(tablica, 10);
  35. wypisanieTablicy(tablica, 10);
  36. wypisanieOdTylu(tablica, 10);
  37.  
  38. return 0;
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment