program main implicit none integer*8::N,i,dot,len,borrow,carry integer*8::big,small,big_t,small_t integer*8,parameter::keta=10000000000_8 character*22::input data big_t,small_t/2*0/ read *,N do i=1,N read *,input len = LEN_TRIM(input) dot = SCAN(input,'.') if(dot.ne.0) then read (input(1:dot-1),*) big read (input(dot+1:len),*) small small = 10**(10-len+dot)*small else read (input(1:len),*) big small = 0 end if big_t = big_t + big if(input(1:1).eq.'-') then small_t = small_t - small else small_t = small_t + small end if ! print '(i0," ",i0," ",i0," ",i0)',big,small,big_t,small_t end do if(small_t.ge.0) then carry = small_t/keta big_t = big_t + carry small_t = MOD(small_t,keta) else borrow = small_t/keta+1 big_t = big_t - borrow small_t = borrow*keta - small_t end if print '(i0,".",i10.10)',big_t,small_t end program main