fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. const int N = 25;
  7. int tab[N];
  8. void losuj(int a, int b) {
  9. srand(time(NULL));
  10. for (int i = 0; i < N; i++)
  11. tab[i] = a + rand() % (b - a + 1);
  12. }
  13. void wypisz() {
  14. for (int i = 0; i < N; i++)
  15. cout << tab[i] << " ";
  16. cout << endl;
  17. }
  18.  
  19. int main() {
  20. losuj(10, 99);
  21. wypisz();
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
64 98 63 32 68 18 47 48 36 65 92 75 71 61 35 25 74 11 46 15 66 88 45 85 27