Advertisement
jpvieiraa

Máximo divisor comum(m.d.c.)

Jul 3rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. a,c=map(int,input().split())
  2. b=0
  3. v=[]
  4. p=0
  5. maior=-99999999999999
  6. if(a>=1 and c<=10000):
  7.  
  8. while(b!=10000):
  9. b=b+1
  10. if(a%b==0 and c%b==0):
  11. v.append(b)
  12. p=p+1
  13. for i in range(p):
  14. if(v[i]>maior):
  15. maior=v[i]
  16. print("m.d.c(12,18)={}".format(maior))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement