Digit sum square REVISED

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

Given a number abcd (where a,b,c,d are digits)
calculate the digit sum a+b+c+d and concatenate the digit sum
to the original number and calculate the digit sum again.

1234 -> 1+2+3+4 = 10 -> 123410
12310 -> 10+1+0 = 11

Options

no deadline, the server will not save your submission

Sample input:_

1234
767
12454
344234
32765
77
8768
348762847283284764298
34324
131233
689162
447943847
987654321
123456789
13579
24680
1137
1227
10110101

Sample output:

[11, 22, 23, 22, 28, 19, 40, 116, 23, 17, 37, 55, 54, 54, 32, 22, 15, 15, 10]

Sample input:_

4321
30030330303
1331415

Sample output:

[11, 27, 27]

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid460.02442013/01/24 08:44:090B / 19B / 27B
2clock460.02212013/01/24 15:33:270B / 21B / 25B
3Histocrat660.02432013/01/22 06:20:530B / ?B / ?B

Perl _

RankUserSizeTimeDateStatistics
1tails220.12942018/02/16 17:04:312B / 9B / 10B
2%20550.02742018/02/12 12:24:370B / 18B / 36B
3teebee550.02182018/02/12 15:48:470B / 21B / 32B
4BioFALSE850.02242013/01/27 09:01:330B / 29B / 54B

Python _

RankUserSizeTimeDateStatistics
1leonid520.03372013/01/25 04:30:5214B / 22B / 14B
2hallvabo (embed)520.05902013/06/03 07:24:3314B / 22B / 14B
3mitchs520.05482014/07/19 18:34:1214B / 22B / 14B
4teebee520.09822014/07/19 19:03:2814B / 22B / 14B
5Dingledooper520.05952021/10/10 08:01:4214B / 22B / 14B
6clock(embed)530.03542013/01/25 13:11:4913B / 22B / 16B
7McBusLuck640.04702020/01/13 23:19:470B / 44B / 18B
8clock740.03942013/01/24 16:08:240B / 39B / 32B
9hallvabo790.04942013/01/21 05:18:090B / 44B / 32B
10rolf810.04122013/01/31 19:09:340B / 54B / 23B
11twobit820.04542013/01/20 05:40:340B / 46B / 32B
12Volatility920.04592013/01/22 10:48:352B / ?B / ?B

Python3 _

RankUserSizeTimeDateStatistics
1mypetlion890.07752018/10/11 03:03:130B / 56B / 28B

Io _

RankUserSizeTimeDateStatistics
1pooq980.14032013/01/20 12:04:170B / 56B / 34B

JavaScript _

RankUserSizeTimeDateStatistics
1madshall980.02592013/07/26 23:53:550B / 45B / 52B
2_nderscore1100.02582013/07/26 10:16:240B / 60B / 48B

K _

RankUserSizeTimeDateStatistics
1teebee410.02282014/12/25 10:45:010B / 6B / 34B

C _

RankUserSizeTimeDateStatistics
1g33k1270.02142013/01/29 14:08:040B / ?B / ?B

Haskell _

RankUserSizeTimeDateStatistics
1henkma830.02602018/02/12 12:09:340B / 50B / 29B
2cojna860.02802013/04/22 00:04:520B / 52B / 28B

AWK _

RankUserSizeTimeDateStatistics
1llhuii700.02112014/07/31 23:59:390B / 31B / 38B
2teebee730.02132014/07/30 03:27:070B / 31B / 41B

jq _

RankUserSizeTimeDateStatistics
1eban630.03082022/02/22 18:58:390B / 27B / 33B
2clock690.02202015/02/11 19:33:220B / 28B / 38B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1McBusLuck830.01962022/02/22 16:09:510B / 39B / 38B

dc _

RankUserSizeTimeDateStatistics
1tails420.02122018/02/14 15:57:140B / 27B / 14B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii700.02172014/08/01 00:41:330B / 31B / 38B
2teebee730.02152014/07/30 03:29:560B / 31B / 41B

Brainfuck _

RankUserSizeTimeDateStatistics
1g33k1630.02682013/01/29 14:46:140B / ?B / ?B

GolfScript _

RankUserSizeTimeDateStatistics
1clock300.06592013/01/20 06:30:340B / 2B / 27B
2tails300.05422013/01/23 22:37:060B / 5B / 24B
3leonid320.04482013/01/24 09:24:070B / 5B / 26B
4twobit340.06022013/01/20 06:48:490B / 7B / 26B
5%20340.04432015/09/12 20:15:560B / 2B / 31B
6nooodl350.04552013/01/21 01:39:000B / ?B / ?B
7%20(symbol)390.05042015/09/12 20:36:320B / 0B / 37B

gs2 _

RankUserSizeTimeDateStatistics
1mitchs90.17142015/09/12 04:19:291B / 4B / 4B
2tails90.15012018/02/14 14:47:311B / 4B / 4B

Nibbles _

RankUserSizeTimeDateStatistics
1tails130.03862022/02/22 09:42:448B / 2B / 3B

FlogScript _

RankUserSizeTimeDateStatistics
1milieu270.06952013/01/24 15:21:060B / ?B / ?B
2clock270.06162013/03/06 02:29:450B / 5B / 21B

Burlesque _

RankUserSizeTimeDateStatistics
1teebee170.02862014/09/17 06:28:310B / 8B / 9B
2Hendrik170.02692014/09/22 19:50:530B / 8B / 9B
3clock170.02652015/01/14 01:26:160B / 8B / 9B
4mroman180.02572013/01/20 03:58:080B / 7B / 11B

Vim _

RankUserSizeTimeDateStatistics
1clock570.05152013/02/04 08:40:249B / 20B / 23B

Scala _

RankUserSizeTimeDateStatistics
1clock744.93902020/01/13 22:31:2212B / 23B / 36B
2rotary-o744.79932020/01/13 23:01:5412B / 23B / 36B
3clock(nocheat)904.44762020/01/13 21:34:580B / 54B / 34B

Logo _

RankUserSizeTimeDateStatistics
1teebee810.02662014/01/06 02:34:430B / 51B / 14B
2clock820.02842013/03/09 01:09:200B / 52B / 20B

Language Ranking_

RankLangUserSizeScore
1gs2mitchs910000
2Nibblestails136923
3Burlesqueteebee175294
4Perltails224090
5FlogScriptmilieu273333
6GolfScriptclock303000
7Kteebee412195
8dctails422142
9Rubyleonid461956
10Pythonleonid521730
11Vimclock571578
12jqeban631428
13AWKllhuii701285
14xgawkllhuii701285
15Scalaclock741216
16Logoteebee811111
17Haskellhenkma831084
18Bash (builtins)McBusLuck831084
19Python3mypetlion891011
20Iopooq98918
21JavaScriptmadshall98918
22Cg33k127708
23Brainfuckg33k163552

return to the top page