Cody

# Problem 44287. sum all digits

Solution 1604684

Submitted on 9 Aug 2018 by Martin C.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = 1; y_correct = 1; assert(isequal(sum_all_digits(x),y_correct))

s = 0 st = '1' s = 1 y = 1

2   Pass
x = 112; y_correct = 4; assert(isequal(sum_all_digits(x),y_correct))

s = 0 st = '112' s = 1 s = 2 s = 4 y = 4

3   Pass
x = 18547; y_correct = 25; assert(isequal(sum_all_digits(x),y_correct))

s = 0 st = '18547' s = 1 s = 9 s = 14 s = 18 s = 25 y = 25

4   Pass
x = 147852369; y_correct = 45; assert(isequal(sum_all_digits(x),y_correct))

s = 0 st = '147852369' s = 1 s = 5 s = 12 s = 20 s = 25 s = 27 s = 30 s = 36 s = 45 y = 45

5   Pass
x = 753159; y_correct = 30; assert(isequal(sum_all_digits(x),y_correct))

s = 0 st = '753159' s = 7 s = 12 s = 15 s = 16 s = 21 s = 30 y = 30

6   Pass
x = 1000245879653254; y_correct = 61; assert(isequal(sum_all_digits(x),y_correct))

s = 0 st = '1000245879653254' s = 1 s = 1 s = 1 s = 1 s = 3 s = 7 s = 12 s = 20 s = 27 s = 36 s = 42 s = 47 s = 50 s = 52 s = 57 s = 61 y = 61