public class Test2__18 { public static void main (String[] args) {
System.out.printf("%-8s%-8s%-8s\n", "a", "b", "pow(a, b)");
int a = 1;
int b = 2;
while (a < 6) {
int c = (int)Math.pow(a, b);
System.out.printf("%-8d%-8d%-8d\n", a, b, c);
a++;
b++;
}
}
}
打印结果:
a b pow(a, b)
1 2 1
2 3 8
3 4 81
4 5 1024
5 6 15625
个位大神的自荐信得分是多少了?我的怎么才7.5分.......
|
|