grodek118

Untitled

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