Guest User

Untitled

a guest
Nov 14th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // This program will be compiled on Ubuntu 18.10 with g++ (Ubuntu 8.2.0-7ubuntu1) 8.2.0
  2. #include <iostream>
  3. #include <random>
  4.  
  5. #define SHANGHAI 0 //上证指数2018年11月15日收盘值*100
  6. #define SHENZHEN 0 //深证成指2018年11月15日收盘值*100
  7.  
  8. int main()
  9. {
  10. std::random_device rd;
  11. std::mt19937 eng(SHANGHAI + SHENZHEN);
  12. std::uniform_int_distribution<> distr(1, 183);
  13.  
  14. for (int i = 0; i < 20; i++)
  15. {
  16. std::cout << distr(eng) << std::endl;
  17. }
  18.  
  19. return 0;
  20. }
Add Comment
Please, Sign In to add comment