Cody

# Problem 1407. Is it an Armstrong number?

Solution 1906390

Submitted on 20 Aug 2019
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   Fail
x = 153; y_correct = 1; assert(isequal(armno(x),y_correct))

y1 = 1 y1 = 1 5 y1 = 1 5 3

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test1 (line 3) assert(isequal(armno(x),y_correct))

2   Fail
x = 143; y_correct = 0; assert(isequal(armno(x),y_correct))

y1 = 1 y1 = 1 4 y1 = 1 4 3

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test2 (line 3) assert(isequal(armno(x),y_correct))

3   Fail
x = 370; y_correct = 1; assert(isequal(armno(x),y_correct))

y1 = 3 y1 = 3 7 y1 = 3 7 0

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test3 (line 3) assert(isequal(armno(x),y_correct))

4   Fail
x = 371; y_correct = 1; assert(isequal(armno(x),y_correct))

y1 = 3 y1 = 3 7 y1 = 3 7 1

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test4 (line 3) assert(isequal(armno(x),y_correct))

5   Fail
x = 145; y_correct = 0; assert(isequal(armno(x),y_correct))

y1 = 1 y1 = 1 4 y1 = 1 4 5

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test5 (line 3) assert(isequal(armno(x),y_correct))

6   Fail
x = 407; y_correct = 1; assert(isequal(armno(x),y_correct))

y1 = 4 y1 = 4 0 y1 = 4 0 7

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test6 (line 3) assert(isequal(armno(x),y_correct))

7   Fail
x = 136; y_correct = 0; assert(isequal(armno(x),y_correct))

y1 = 1 y1 = 1 3 y1 = 1 3 6

Undefined function or variable 'len'. Error in armno (line 7) y=sum(y1.^len) Error in Test7 (line 3) assert(isequal(armno(x),y_correct))