import java.util.Scanner; /** * Created by feyman1120 on 2017/11/23. */ public class Main { public static void main(String [] args){ Scanner scan = new Scanner(System.in); while (scan.hasNext()){ int st = scan.nextInt(); int ed = scan.nextInt(); /*交换两个数*/ if (st > ed){ st = st ^ ed; ed = st ^ ed; st = st ^ ed; } boolean flg = false; for (int i = st; i <= ed; ++i){ int th = i / 100; int hu = i / 10 % 10; int si = i % 10; if (i == th * th * th + hu * hu * hu + si * si * si){ if (!flg){ System.out.print(i); flg = true; }else { System.out.print(" " + i); } } } if (!flg){ System.out.println("no"); }else { System.out.println(); } } } }
hdu_2010 水仙花数
最新推荐文章于 2021-09-28 11:32:24 发布