Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- void func(int m, int i, int c) {
- int S;
- cout << "Введите исходное число S:\n";
- cin >> S;
- S = (m * S + i) % c;
- cout << S;
- }
- int main()
- {
- setlocale(LC_ALL, "RUSSIAN");
- cout << "Псевдогенератор случайных чисел:\n";
- double S;
- int m;
- int i;
- int V;
- cout << "Введите номер операции V:\n";
- cin >> V;
- switch (V)
- {
- case 1: func(37, 3, 64);
- break;
- case 2: func(25173, 13849, 65537);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement