SUM!

Write a program to sum of digits of given integer number.

IN

1
2

OUT

3

IN

50
23

OUT

73

IN

20
20

OUT

40

IN

70
21

OUT

91

IN

22
40

OUT

62
Login to submit solution


17 symbols bash failed test 1 Code error

./code: line 1: bc: command not found

Sat Nov 5 13:16:35 2016 PFischbeck
paste -sd+ - | bc
9 symbols perl failed test 1 Code error

Can't emulate -e on #! line at ./code line 1.

Sat Nov 5 19:12:57 2016 k-mx
#!/usr/bin/perl -pe
$_+=<>
9 symbols perl failed test 1 Code error

Can't emulate -e on #! line at ./code line 1.

Sat Nov 5 19:14:06 2016 k-mx
#!/usr/bin/perl -pe
$_+=<>
10 symbols perl failed test 1 Code error

Can't emulate -e on #! line at ./code line 1.

Sat Nov 5 19:22:42 2016 k-mx
#!/usr/bin/perl -pne
$_+=<>
3 symbols python3 failed test 1 Code error

Traceback (most recent call last): File "./code", line 1, in <module> s.Q NameError: name 's' is not defined

Sun Jan 8 02:38:36 2017 vockyX
s.Q
24 symbols lua failed test 1 Wrong answer
3.0
instead of
3
Sat Apr 29 19:16:09 2017 joshlotriet
a=io.read;print(a()+a())
46 symbols perl failed test 1 Code error

Bareword found where operator expected at ./code line 1, near ") getLine" (Missing operator before getLine?) syntax error at ./code line 1, near ") getLine getLine " Execution of ./code aborted due to compilation errors.

Thu Jul 20 06:17:02 2017 quantum-dan
fmap (\a b -> a + b) getLine getLine >>= print
36 symbols haskell failed test 1 Code error

code:1:1: Parse error: naked expression at top level Perhaps you intended to use TemplateHaskell

Thu Jul 20 06:17:42 2017 quantum-dan
(fmap (+)) getLine getLine >>= print
21 symbols perl failed test 1 Code error

Can't modify constant item in scalar assignment at ./code line 1, near "input;" Execution of ./code aborted due to compilation errors.

Tue Feb 13 13:19:37 2018 drafear
i=input;print i()+i()
6 symbols perl failed test 1 Wrong answer

                      
instead of
3
Tue Feb 13 13:21:25 2018 drafear
$_+=<>
6 symbols perl failed test 1 Wrong answer

                      
instead of
3
Tue Feb 13 13:21:59 2018 drafear
$_+=<>
37 symbols python3 failed test 1 Wrong answer
1
instead of
3
Sun Mar 18 02:38:46 2018 Krimpoche
print(sum([int(i) for i in input()]))
3 symbols pyth failed test 1 Wrong answer
2
instead of
3
Sun Mar 18 02:53:25 2018 Krimpoche
+QQ
3 symbols pyth failed test 1 Wrong answer
1
instead of
3
Sun Mar 18 04:30:15 2018 Krimpoche
iz2
2 symbols pyth failed test 1 Code error

Traceback (most recent call last): File "/usr/bin/pyth.py", line 713, in <module> exec(py_code_line, environment) File "<string>", line 1, in <module> TypeError: plus() missing 1 required positional argument: 'b'

Mon Mar 26 23:52:26 2018 GolfingSuccess
+E

View all solutions