Advertisement
AlimusSifar

Mixed Fractions - Toph.co - Beginner

Mar 9th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import math
  2.  
  3. tokens = input().split()
  4. dividend = int(tokens[0])
  5. divisor = int(tokens[1])
  6.  
  7. whole = math.floor(dividend/divisor)
  8. numerator = dividend - whole * divisor
  9. denominator = divisor
  10.  
  11. print(str(whole) + " " + str(numerator) + " " + str(denominator))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement