Advertisement
MrSerzh

Untitled

Sep 23rd, 2021
1,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.     setlocale(LC_ALL, "Russian");
  8.     int iter;
  9.     cout << "Введите количество итераций: ";
  10.     cin >> iter;
  11.     unsigned value = unsigned(time(nullptr));
  12.     for (int i = 0; i < iter; ++i)
  13.     {
  14.         cout << i << ") ";
  15.         if (i % 13 == 0)
  16.         {
  17.             value = (value * 652651931 + 1132987654) % 100000;
  18.             cout << value << endl;
  19.         }
  20.         else if (i % 3 == 0)
  21.         {
  22.             value = (value * 732129 + 239111221) % 100000;
  23.             cout << value << endl;
  24.         }
  25.         else
  26.         {
  27.             value = (value * 654112 + 95121321) % 10000;
  28.             cout << value << endl;
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement