Skip to content

Instantly share code, notes, and snippets.

@aximov aximov/goudouhou.cc
Created Jul 6, 2018

Embed
What would you like to do?
合同法による乱数の発生
#include <bits/stdc++.h>
using namespace std;
int irand(int ir) {
int a = 5, c = 1, m = 16;
return (a * ir + c) % m;
}
int main() {
int r = 0;
for (int i = 0; i < 32; ++i) {
r = irand(r);
cout << r << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.