标签:div indicator 训练 alt code lap 落地 http 乘法
1 public class Homework01 { 2 public static void main(String[] args) { 3 int a=0,b=0,c=0; 4 System.out.print("3位数的所有水仙花数为:"); 5 for (int i = 100; i < 1000; i++) { 6 a = i / 100;// 百位 7 b = i % 100 / 10;// 十位 8 c = i % 100 % 10;// 个位 9 if (i == a * a * a + b * b * b + c * c * c) { 10 System.out.print(i + " "); 11 } 12 } 13 } 14 }
1 public class Homework02 { 2 public static void main(String[] args) { 3 double sum = 0, hight = 100; 4 for (int i = 1; i <= 10; i++) { 5 sum = sum + 2 * hight; 6 hight /= 2; 7 System.out.println("第"+i+"次落地时共经过" + sum + "米,落地后反弹"+hight+"米"); 8 } 9 } 10 }
1 public class Homework03 { 2 public static void main(String[] args) { 3 int x, y; 4 System.out.print("\t1\t2\t3\t4\t5\t6\t7\t8\t9"); 5 for (x = 1; x < 10; x++) { 6 System.out.print("\n" + x); 7 for (y = 1; y <= x; y++) { 8 System.out.print("\t" + x + "*" + y + "=" + x * y); 9 } 10 11 } 12 } 13 }
1 public class Homework04 { 2 public static void main(String[] args) { 3 for (int i = 0; i <=20; i++) { 4 for (int j = 0; j <Math.abs(10-i); j++) { 5 System.out.print(" "); 6 } 7 for (int k = 0; k <=(10-Math.abs(i-10)); k++) { 8 System.out.print("* "); 9 } 10 System.out.println(); 11 } 12 } 13 }
标签:div indicator 训练 alt code lap 落地 http 乘法
原文地址:http://www.cnblogs.com/woooooody/p/6020974.html