摘要: 所谓水仙花数是指数字各位数的位长次幂之和等于它本身,举例说明:153,是一个三位数,位长为3,各个位上的数字分别为1,5,3,则13+53+33=153,等于他本身,则153是水仙花数。 编程求解所有三位数的水仙花数 1 public class Daffnum { 2 public static void main(String[] args) { 3 // TODO Auto-generated method stub 4 for (int i = 100; i < 1000; i++) { 5 int h=i/100%... 阅读全文
posted @ 2013-11-26 13:25 sdrzlyz 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 笔试,9x9乘法表输出的问题,看似简单,回来把当时写的结果输入一遍后发现,并没有想象中的“完美”。把改写的pos在此,警示。。。不要忘记任何细节。 1 public class NXN { 2 public static void main(String[] args) { 3 // TODO Auto-generated method stub 4 for (int i = 1; i < 10; i++) { 5 for (int j = 1; j < 10; j++) { 6 if (j<=... 阅读全文
posted @ 2013-11-26 10:19 sdrzlyz 阅读(557) 评论(0) 推荐(0) 编辑