fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4. unsigned int k = 1U, seed = 12345U, randomNumbers[55];
  5.  
  6. randomNumbers[54] = seed;
  7. for(unsigned int i = 1U; i <= 54U; ++i) {
  8. unsigned int ii = ((21U * i) % 55U) - 1U;
  9. if(ii > 54U)
  10. std::cout << ii << std::endl;
  11. randomNumbers[ii] = k;
  12. k = seed - k;
  13. seed = randomNumbers[ii];
  14. }
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2848KB
stdin
Standard input is empty
stdout

Standard output is empty