num?=?num_crop(input);
if?num(1,1)^3?+?num(1,2)^3?+?num(1,3)^3?==?input
output?=?floor(input/10)?+?num(1,3)*100;
else
temp?=?(sum(num)+21)?*?10;
num?=?num_crop(temp);
%?exchange
num(1,1)?=?num(1,1)?+?num(1,2);
num(1,2)?=?num(1,1)?-?num(1,2);
num(1,1)?=?num(1,1)?-?num(1,2);
%?step2
temp?=?num_crop(num(1,3)*9);
num(1,3)?=?temp(1,2);
output?=?num(1,1)*100?+?num(1,2)*10?+?num(1,3);
end
end
function?num?=?num_crop(input)
temp?=?floor(input/10);
num(1,3)?=?input?-?temp?*?10;
temp?=?floor(temp/10);
num(1,2)?=?floor(input/10)?-?temp?*?10;
temp?=?floor(temp/10);
num(1,1)?=?floor(input/100)?-?temp?*?10;
end