Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = open('input.txt', 'r', encoding='utf-8')
- out = []
- for x in a.readlines():
- k1, k2 = map(int, x.split())
- mn = min(k1, k2)
- mx = max(k1, k2)
- gip = (mn ** 2 + mx ** 2) ** 0.5
- tg = mx / mn
- out.append(
- 'меньший катет: ' + str(mn) +
- ', больший катет: ' + str(mx) +
- ', гипотенуза: ' + str(gip) +
- ', косинус: ' + str(mn / gip) +
- ', синус: ' + str(mx / gip) +
- ', тангенс: ' + str(tg) +
- ', котангенс: ' + str(1 / tg) + '\n'
- )
- a.close()
- a = open('input.txt', 'w', encoding='utf-8')
- a.writelines(out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement