fork download
  1. #include <iostream>
  2.  
  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.  
  14. void wypisz() {
  15. for (int i = 0; i < N; i++)
  16. cout << tab[i] << " ";
  17. cout << endl;
  18. }
  19.  
  20. int main() {
  21. losuj(10, 99);
  22. wypisz();
  23. return 0;
  24. }
Success #stdin #stdout 0s 5304KB
stdin
1
2
10
42
11
stdout
90 11 72 19 33 98 41 71 31 37 60 13 69 55 72 27 98 61 45 78 61 34 11 30 46