Cody

Problem 2370. Fermat's last theorem - again

Solution 2673980

Submitted on 10 Jul 2020
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 = 25; y=sumOfSqr(x); v=y(1)^2 + y(2)^2; assert(isequal(x,v)) assert(round(y(1))==y(1)) assert(round(y(2))==y(2))

Output argument "y" (and maybe others) not assigned during call to "sumOfSqr". Error in Test1 (line 2) y=sumOfSqr(x);

2   Fail
x = 41; y=sumOfSqr(x); v=y(1)^2 + y(2)^2; assert(isequal(x,v)) assert(round(y(1))==y(1)) assert(round(y(2))==y(2))

Output argument "y" (and maybe others) not assigned during call to "sumOfSqr". Error in Test2 (line 2) y=sumOfSqr(x);

3   Fail
x = 7; y=sumOfSqr(x); assert(isempty(y));

Output argument "y" (and maybe others) not assigned during call to "sumOfSqr". Error in Test3 (line 2) y=sumOfSqr(x);

4   Fail
x = 391250; y=sumOfSqr(x); v=y(1)^2 + y(2)^2; assert(isequal(x,v)) assert(round(y(1))==y(1)) assert(round(y(2))==y(2))

Output argument "y" (and maybe others) not assigned during call to "sumOfSqr". Error in Test4 (line 2) y=sumOfSqr(x);

5   Fail
x = 288; y=sumOfSqr(x); v=y(1)^2 + y(2)^2; assert(isequal(x,v)) assert(round(y(1))==y(1)) assert(round(y(2))==y(2))

Output argument "y" (and maybe others) not assigned during call to "sumOfSqr". Error in Test5 (line 2) y=sumOfSqr(x);

6   Fail
x = 1; y=sumOfSqr(x); v=y(1)^2 + y(2)^2; assert(isequal(x,v)) assert(round(y(1))==y(1)) assert(round(y(2))==y(2))

Output argument "y" (and maybe others) not assigned during call to "sumOfSqr". Error in Test6 (line 2) y=sumOfSqr(x);

Suggested Problems

More from this Author44

Community Treasure Hunt

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

Start Hunting!