시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 75 12 8 21.622%

문제

상근이는 구조체를 이용해서 실수를 저장하려고 한다. 구조체에는 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

힌트

W3sicHJvYmxlbV9pZCI6Ijk0MTEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyZTRcdWMyMTggXHVhY2M0XHVjMGIwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVhZDZjXHVjODcwXHVjY2I0XHViOTdjIFx1Yzc3NFx1YzZhOVx1ZDU3NFx1YzExYyBcdWMyZTRcdWMyMThcdWI5N2MgXHVjODAwXHVjN2E1XHVkNTU4XHViODI0XHVhY2UwIFx1ZDU1Y1x1YjJlNC4gXHVhZDZjXHVjODcwXHVjY2I0XHVjNWQwXHViMjk0IDMwXHVhYzFjXHVjNzU4IFx1YzIyYlx1Y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