Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
def congruence(x): list_nums = [] list_index = [] for index in range(x): m = random.randint(1, 1000) * 2 a = random.randint(1, 1000) * 2 + 1 x0 =random.randint(1, 1000) * 2 + 1 x_i = (a * x0 - 1) % m r_i = x_i / m print( r_i, index) list_nums.append(r_i) list_index.append(index) return list_nums, list_index def random_(x): list_nums = [] list_index = [] for index in range(x): m = random.random() print(m, index) list_nums.append(m) list_index.append(index) return list_nums, list_index tuple_cords_congruence = congruence(int(input('Конгруэнтный метод. Введите число: '))) tuple_cords_random = random_(int(input('Рандомный метод. Введите число: '))) print(tuple_cords_congruence) print(tuple_cords_random)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)