fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n = 30;
  6. int c = 15487457;
  7. int a = n+1;
  8.  
  9. int x = 3124;
  10. for(int i = 0; i < n; ++i){
  11. x = (a*x+c)%n;
  12. std::cout<<(x)<<std::endl;
  13. }
  14.  
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
21
8
25
12
29
16
3
20
7
24
11
28
15
2
19
6
23
10
27
14
1
18
5
22
9
26
13
0
17
4