Digit sum square

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.

Required format:
[[digits, sum], sum_2,...]

e.g

123 -> [[1, 2, 3, 6], 12]

Options

no deadline, the server will not save your submission

Sample input:_

1234
6767
8686
787
6546
123456789

Sample output:

[[1, 2, 3, 4, 10], 20, [6, 7, 6, 7, 26], 52, [8, 6, 8, 6, 28], 56, [7, 8, 7, 22], 44, [6, 5, 4, 6, 21], 42, [1, 2, 3, 4, 5, 6, 7, 8, 9, 45], 90]

Ranking

Perl _

RankUserSizeTimeDateStatistics
1teebee650.01142014/07/19 11:19:010B / 24B / 40B
2BioFALSE1350.01592013/01/27 09:18:127B / 29B / 88B

Python _

RankUserSizeTimeDateStatistics
1hallvabo660.01762013/01/21 04:40:390B / 34B / 29B
2clock660.02732013/01/21 14:52:590B / 34B / 29B
3leonid660.03682013/10/05 07:11:060B / 37B / 26B
4starmie660.03162015/03/04 16:11:300B / 34B / 31B
5mitchs660.02872015/10/18 02:33:240B / 37B / 26B
6twobit680.01572013/01/20 04:47:170B / 37B / 28B
7rolf680.01712013/01/22 08:40:520B / 37B / 28B

Python3 _

RankUserSizeTimeDateStatistics
1mitchs670.05502015/10/18 02:38:160B / 34B / 31B

K _

RankUserSizeTimeDateStatistics
1teebee560.01492016/04/17 09:31:110B / 10B / 44B

C _

RankUserSizeTimeDateStatistics
1g33k1610.00022013/01/29 14:09:150B / ?B / ?B

Haskell _

RankUserSizeTimeDateStatistics
1henkma1050.01132013/01/24 23:27:270B / 54B / 43B
2cojna1100.01572013/01/24 17:22:360B / 56B / 45B

AWK _

RankUserSizeTimeDateStatistics
1llhuii760.01052014/09/22 22:14:140B / 22B / 51B
2teebee790.01062014/07/29 16:03:080B / 26B / 49B

jq _

RankUserSizeTimeDateStatistics
1clock610.01102015/02/11 19:33:160B / 23B / 36B
2teebee810.01122014/12/15 18:04:410B / 31B / 47B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii760.01082014/09/22 22:06:200B / 23B / 50B
2teebee790.01612014/07/29 16:08:080B / 26B / 49B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs (cheat)1060.02492015/10/05 02:29:1711B / 24B / 59B
2g33k1860.01482013/01/29 14:12:050B / ?B / ?B

gs2 _

RankUserSizeTimeDateStatistics
1mitchs90.10182015/10/11 12:36:462B / 3B / 4B

Burlesque _

RankUserSizeTimeDateStatistics
1teebee170.01222014/09/17 06:50:390B / 8B / 9B
2Hendrik170.01252014/09/22 19:49:320B / 8B / 9B
3clock170.01202015/01/14 01:25:360B / 8B / 9B

Language Ranking_

RankLangUserSizeScore
1gs2mitchs910000
2Burlesqueteebee175294
3Kteebee561607
4jqclock611475
5Perlteebee651384
6Pythonhallvabo661363
7Python3mitchs671343
8xgawkllhuii761184
9AWKllhuii761184
10Haskellhenkma105857
11Brainfuckmitchs (cheat)106849
12Cg33k161559

return top