Cody

Problem 2690. Armstrong Number

Solution 3105946

Submitted on 7 Oct 2020 by JB
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))

sum = 9 y = logical 1

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

sum = 27 sum = 370 sum = 371 y = logical 1

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

sum = 64 sum = 64 sum = 407 y = logical 1

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

sum = 1 sum = 1297 sum = 1378 sum = 1634 y = logical 1

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

sum = 7776 sum = 40544 sum = 99593 sum = 102718 sum = 105843

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

sum = 15625 sum = 19721 sum = 281865 sum = 544009 sum = 544738 sum = 548834 y = logical 1

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

sum = 1 sum = 823544 sum = 839928 sum = 839929 sum = 1663472 sum = 1663600 sum = 1741725 y = logical 1

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!