digit sum until no change

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

f(x) = 1st digit of x + 2nd digit of x + ... + last digit of x

f(7) = 7
f(55) = 10
f(100) = 1
f(20192019201920192019) = 60

for all 10 lines, print f(x), repeat f(y) on the same line until no change separated by spaces

7: 7
55: 10 1
99999999999: 99 18 9

PS. \n at the end of all 10 lines because I am very nice :)

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

7
55
100
20192019201920192019
2300375307592024725842496
2061913817187830303568138
1719652887001645132447660
608151963456967130688992
559125563855553699257396
1945302880216548672024940

Sample output:

7
10 1
1
60 6
99 18 9
102 3
103 4
122 5
128 11 2
100 1

Sample input:_

1861436587821970027787818
326289172319285690688178
1788461159070311361905172
308927083631017941736021
132632831615610849491973
27388862610835465077638
615951394902526366660430
142049713975717838393742
2196997868587946408223314
1391584248947717293606256

Sample output:

124 7
121 4
96 15 6
91 10 1
102 3
113 5
101 2
114 6
131 5
119 11 2

Sample input:_

1272707626717540460197474
1120979345726602230167363
1361742339107870567955641
1180843073826810701333938
802662329199440559286833
541184281901749936152194
1435301411703501278767869
2043280480859793085297805
993401686999389422684916
505919069830564912678555

Sample output:

106 7
95 14 5
110 2
97 16 7
114 6
104 5
99 18 9
116 8
135 9
118 10 1

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1Histocrat530.03292019/04/19 00:18:570B / 17B / 33B
2rotary-o530.04172019/05/02 09:39:330B / 17B / 33B
3Golzeb650.03352019/04/18 10:44:490B / 32B / 30B
4Unihedron ユニ1030.02732019/04/18 06:28:560B / 56B / 38B

Ruby2 _

RankUserSizeTimeDateStatistics
1hako510.15022019/04/20 12:36:230B / 21B / 27B
2Histocrat510.15772019/04/27 05:20:080B / 21B / 27B
3rotary-o510.15322019/05/04 18:22:010B / 21B / 27B
4letranger520.15162019/04/19 00:01:000B / 22B / 27B
5Golzeb650.14702019/04/18 10:45:070B / 32B / 30B
6Unihedron ユニ980.15482019/04/18 06:26:330B / 50B / 41B

Perl _

RankUserSizeTimeDateStatistics
1tails510.03602019/05/20 10:47:040B / 21B / 30B

Python _

RankUserSizeTimeDateStatistics
1mitchs720.07572019/04/18 23:52:580B / 46B / 17B
2llhuii720.07182019/05/19 08:29:490B / 46B / 17B
3hallvabo810.07402019/04/18 23:10:200B / 50B / 20B
4rolf870.07692019/06/08 05:34:060B / 52B / 21B
5McBusLuck930.08292019/05/20 01:54:510B / ?B / ?B

Python3 _

RankUserSizeTimeDateStatistics
1mypetlion890.12082019/05/08 08:02:170B / 49B / 32B

JavaScript _

RankUserSizeTimeDateStatistics
1xulapp780.03982019/06/25 04:01:270B / 42B / 33B

C _

RankUserSizeTimeDateStatistics
1tails1010.03162019/05/20 14:12:540B / 52B / 48B
2TokusiN1210.03162019/06/18 22:12:010B / 60B / 56B
3chocobi1280.03142019/05/19 22:45:310B / 68B / 59B

Bash _

RankUserSizeTimeDateStatistics
1McBusLuck1220.05022019/05/02 05:49:170B / ?B / ?B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails740.18672019/04/28 02:24:470B / 27B / 38B
2McBusLuck1220.04582019/04/27 23:42:390B / ?B / ?B

><> _

RankUserSizeTimeDateStatistics
1Unihedron ユニ800.37102019/04/18 06:02:290B / 23B / 46B

gs2 _

RankUserSizeTimeDateStatistics
1tails130.24852019/04/18 06:44:543B / 6B / 4B
2mitchs130.18012019/04/18 15:17:194B / 7B / 2B

goruby _

RankUserSizeTimeDateStatistics
1Golzeb570.06182019/04/18 10:49:410B / 25B / 29B
2Unihedron ユニ870.10522019/04/18 06:38:110B / 41B / 39B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o907.12502019/05/02 09:22:510B / 48B / 36B

Language Ranking_

RankLangUserSizeScore
1gs2tails1310000
2Ruby2hako512549
3Perltails512549
4RubyHistocrat532452
5gorubyGolzeb572280
6Pythonmitchs721805
7Bash (builtins)tails741756
8JavaScriptxulapp781666
9><>Unihedron ユニ801625
10Python3mypetlion891460
11Scalarotary-o901444
12Ctails1011287
13BashMcBusLuck1221065

return to the top page