시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 105 24 18 29.508%

문제

상근이는 구조체를 이용해서 실수를 저장하려고 한다. 구조체에는 30개의 숫자를 저장할 수 있는 정수 배열 (digits), 소수점의 위치를 나타내는 정수 (decpt), 부호(+/-)를 나타내는 sign이 있다. 예를 들어, -218.302869584는 아래와 같이 저장할 수 있다.

0.0000123456789는 아래와 같이 저장할 수 있다.

실수가 주어졌을 때, 상근이가 만든 방법을 이용해 합을 구하는 프로그램을 작성하시오.

입력

첫째 줄에 테스트 케이스의 개수가 주어진다. 각 테스트 케이스는 여러 개의 실수로 이루어져 있으며, 각 테스트 케이스의 마지막에는 0이 주어진다. 입력으로 주어지는 실수의 유효 숫자는 최대 30이고, 각 테스트 케이스는 최대 100개의 실수로 이루어져 있다.

출력

각 테스트 케이스마다 입력으로 주어진 실수의 합을 출력한다. 각 실수를 출력할 때, 0이 아닌 마지막 자리까지 출력한다. 절대로 반올림을 하면 안 된다.

예제 입력 1

4
4.12345678900000000005
-0.00000000012
0
-1300.1
1300.123456789
0.0000000012345678912345
0
1500.61345975
-202.004285
-8.60917475
0
-218.302869584
200.0000123456789
0

예제 출력 1

4.12345678888000000005
0.0234567902345678912345
1290
-18.3028572383211
W3sicHJvYmxlbV9pZCI6Ijk0MTEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyZTRcdWMyMTggXHVhY2M0XHVjMGIwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVhZDZjXHVjODcwXHVjY2I0XHViOTdjIFx1Yzc3NFx1YzZhOVx1ZDU3NFx1YzExYyBcdWMyZTRcdWMyMThcdWI5N2MgXHVjODAwXHVjN2E1XHVkNTU4XHViODI0XHVhY2UwIFx1ZDU1Y1x1YjJlNC4gXHVhZDZjXHVjODcwXHVjY2I0XHVjNWQwXHViMjk0IDMwXHVhYzFjXHVjNzU4IFx1YzIyYlx1Yzc5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