for i=100:999 a=fix(i/100); % 取百位 b=rem(fix(i/10),10); % 取十位 c=rem(i,10); % 取个位 if a^3+b^3+c^3==i disp(i); end end