MarcinKrol

Zad 7

May 13th, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. #include <cstdlib>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. void tablica (int tab[],int a)
  9. {
  10. for (int i=0; i<a; i++)
  11. {
  12. tab[i]=1+rand()%(50);
  13. cout << tab[i] << endl;
  14.  
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. srand(time(NULL));
  21. int tab[10];
  22. tablica(tab,10);
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment