Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- void getRandom(int m, int c,int i)
- {
- int S[14000];
- S[0] = 1;
- for (int n = 0; n < i; n++)
- {
- S[n + 1] = ((S[n]) * m + n) % c;
- cout << S[n + 1] << endl;
- }
- }
- int main() {
- setlocale(LC_ALL, "Russian");
- int m, i, c;
- cout << "Введите m";
- cin >> m;
- cout << "Введите i";
- cin >> i;
- cout << "Введите c";
- cin >> c;
- getRandom(m,c,i);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement