标签:static oid arraylist for add highlight lis int get
/** * 水仙花数 */ public static void findDaffodilNumbe() { for (int i = 100; i < 999; i++) { int data = 0; List<Integer> list = getList(i); for (int j = 0; j < list.size(); j++) { data += (int)Math.pow(list.get(j), 3); } if (data == i) { System.out.print(data + " "); } } } public static List<Integer> getList(int n) { List<Integer> list = new ArrayList<Integer>(); list.add(n % 10); list.add(n / 10 % 10); list.add(n / 100); return list; }
标签:static oid arraylist for add highlight lis int get
原文地址:http://www.cnblogs.com/wangxiaowang/p/7818771.html