Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import sys
  2.  
  3. x= raw_input("qual o primeiro numero?")
  4. y= raw_input("qual o segundo numero?")
  5. cont =0
  6. for p in x:
  7. if p=='0':
  8. cont =cont+1
  9. else:
  10. break
  11. n1=x[cont:]
  12. cont=0
  13. for p in y:
  14. if p=='0':
  15. cont =cont+1
  16. else:
  17. break
  18. n2=y[cont:]
  19. cont=0
  20. if '.' in n1:
  21. for p in n1:
  22. if p=='.':
  23. break
  24. else:
  25. cont=cont+1
  26. n1=n1[:cont]
  27. cont=0
  28. if '.' in n2:
  29. for p in n2:
  30. if p=='.':
  31. break
  32. else:
  33. cont=cont+1
  34. n2=n2[:cont]
  35. n1=int(n1)
  36. n2=int(n2)
  37. print(n1+n2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement