What's wrong with my random number generator?

前端 未结 3 1709
借酒劲吻你
借酒劲吻你 2021-01-17 04:14

I\'m just diving into some C++ and I decided to make a random number generator (how random the number is, it really doesn\'t matter). Most of the code is copied off then net

3条回答
  •  误落风尘
    2021-01-17 04:36

    Add srand before the loop

     srand((unsigned)time(0));
      for(int i =0;i < 100;i++)
        {
            std::cout << random_number(3,10) << endl;
        }
    

提交回复
热议问题