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

View all solutions