Все задачи на 5.10.17 13:00
This commit is contained in:
11
uts/session_py/8.py
Normal file
11
uts/session_py/8.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from random import *
|
||||
|
||||
n = 10000
|
||||
k = 0
|
||||
|
||||
for i in range(n):
|
||||
y = randint(0, 7) + random()
|
||||
x = randint(0, 9) + random()
|
||||
if (y <= 4 * x) and (y <= 10-x) and (y >= 0):
|
||||
k += 1
|
||||
print((k/n)*80)
|
||||
Reference in New Issue
Block a user