Toliak

asdasd

Feb 14th, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from decimal import *
  2.  
  3. def remove_exponent(d):
  4.     return d.quantize(Decimal(1)) if d == d.to_integral() else d.normalize()
  5.  
  6. getcontext().prec = 20
  7.  
  8. inp = input()
  9. a = inp.split(' ')
  10. array_ = []
  11. sum_ = Decimal('0')
  12. c = int(0)
  13. len_ = -9999
  14. for i in a:
  15.     ar_ = a[c].split('.')
  16.     len__ = len(str(ar_[1]))
  17.     len_ = len__ if (len_<len__) else len_
  18.     c = c+1
  19.  
  20. c = int(0)
  21. for i in a:
  22.     sum_ += Decimal(str(a[c]))
  23.     c=c+1
  24. print('{0:f}'.format(sum_))
Advertisement
Add Comment
Please, Sign In to add comment