Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import math
  2. inp = open ("division.in")
  3. outp = open ("division.out", "w")
  4. a, b = map(int, inp.readline().split( ))
  5. if b == 0 :
  6. print("Na nol' delit' nel'zya!!!", file = outp)
  7. else:
  8. c=a/b
  9. d=-c
  10. if (a>0) and (b<0):
  11. print (int(c), file = outp)
  12. else:
  13. if (a<0) and (b>0):
  14. print (-math.ceil(d), file = outp)
  15. else:
  16. if (a<0) and (b<0):
  17. print (math.ceil(c), file = outp)
  18. else:
  19. print (int(c), file = outp)
  20. inp.close ()
  21. outp.close ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement