Cody

# Problem 2690. Armstrong Number

Solution 808027

Submitted on 16 Jan 2016 by Shishir Patel
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 = 9; y_correct = 1; assert(isequal(Armstrong(x),y_correct))

str = 9 l = 1 sum = 0 sum = 9 y = 1

2   Pass
%% x = 371; y_correct = 1; assert(isequal(Armstrong(x),y_correct))

str = 371 l = 3 sum = 0 sum = 27 sum = 370 sum = 371 y = 1

3   Pass
%% x = 407; y_correct = 1; assert(isequal(Armstrong(x),y_correct))

str = 407 l = 3 sum = 0 sum = 64 sum = 64 sum = 407 y = 1

4   Pass
%% x = 1634; y_correct = 1; assert(isequal(Armstrong(x),y_correct))

str = 1634 l = 4 sum = 0 sum = 1 sum = 1297 sum = 1378 sum = 1634 y = 1

5   Pass
%% x = 68955; y_correct = 0; assert(isequal(Armstrong(x),y_correct))

str = 68955 l = 5 sum = 0 sum = 7776 sum = 40544 sum = 99593 sum = 102718 sum = 105843 y = 0

6   Pass
%% x = 548834; y_correct = 1; assert(isequal(Armstrong(x),y_correct))

str = 548834 l = 6 sum = 0 sum = 15625 sum = 19721 sum = 281865 sum = 544009 sum = 544738 sum = 548834 y = 1

7   Pass
%% x = 1741725; y_correct = 1; assert(isequal(Armstrong(x),y_correct))

str = 1741725 l = 7 sum = 0 sum = 1 sum = 823544 sum = 839928 sum = 839929 sum = 1663472 sum = 1663600 sum = 1741725 y = 1

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!