fork download
  1. #include <iostream>
  2. #include <time.h>
  3. using namespace std;
  4.  
  5. unsigned long long delphi_rand_seed = time(NULL);
  6.  
  7.  
  8. constexpr auto DELPHI_RAND_MAX = 4294967295;
  9. inline unsigned long delphi_rand(void)
  10. {
  11. delphi_rand_seed *= 134775813;
  12. delphi_rand_seed += 1;
  13. return (unsigned long)(delphi_rand_seed >> 32);
  14. }
  15.  
  16.  
  17.  
  18. int main() {
  19. for (int i=0;i<16;i++)
  20. cout<<delphi_rand()<<" ";
  21. cout<<"\n\n";
  22.  
  23. srand(time(NULL)); //seed генератора. Если поменять, будет не с единицы.
  24. for (int i=0;i<16;i++)
  25. cout<<rand()<<" ";
  26. return 0;
  27. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
47176920 3911406559 1568504713 2988626698 1582667820 479461598 3671504537 2095304919 743041368 199384422 341807091 3368213103 3019154923 855118240 2043226656 1814219309 

1748879628 375043015 2066022819 334874771 1094809264 2105398669 1518661759 1499216191 263457613 1449477689 1783537639 1755802934 767179686 2124400691 307047086 2129532144