Kosty_Fomin

Untitled

Apr 11th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. a = 1653750
  5. b = 780
  6.  
  7. def gcd(a, b):
  8.     if b == 0:
  9.         return a
  10.     else:
  11.         return gcd(b, a % b)
  12.  
  13. def mcd(n,m):
  14.     return (n/gcd(n,m))*m
  15.  
  16.  
  17. print "НОД:",gcd(a,b)
  18.  
  19. print"НОК:",mcd(a,b)
Advertisement
Add Comment
Please, Sign In to add comment