시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB201452925.217%

문제

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

출처

ICPC > Regionals > Asia Pacific > Thailand > Asia Thailand National Programming Contest > 2010 ACM-ICPC Thailand National Programming Contest D번

  • 문제를 번역한 사람: baekjoon
  • 데이터를 추가한 사람: bupjae