Cody

Solution 1256282

Submitted on 24 Aug 2017 by Francis Naldo
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))

y = 0 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 0

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

y = 0 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 112 x = 12 x = 2 x = 0

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

y = 0 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 18547 x = 8547 x = 547 x = 47 x = 7 x = 0

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

y = 0 x = 147852369 x = 147852369 x = 147852369 x = 147852369 x = 147852369 x = 147852369 x = 147852369 x = 47852369 x = 7852369 x = 852369 x = 52369 x = 2369 x = 369 x = 69 x = 9 x = 0

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

y = 0 x = 753159 x = 753159 x = 753159 x = 753159 x = 753159 x = 753159 x = 753159 x = 753159 x = 753159 x = 753159 x = 53159 x = 3159 x = 159 x = 59 x = 9 x = 0

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

y = 0 x = 2.4588e+11 x = 2.4588e+11 x = 2.4588e+11 x = 2.4588e+11 x = 4.5880e+10 x = 5.8797e+09 x = 879653254 x = 79653254 x = 9653254 x = 653254 x = 53254 x = 3254 x = 254 x = 54 x = 4 x = 0

Suggested Problems

More from this Author4