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 0.01s 5304KB
stdin
Standard input is empty
stdout
66 76 75 29 82 39 30 87 91 97 40 12 47 72 51 44 29 87 43 79 84 27 78 24 86