Java语言程序设计基础篇编程练习题2.18示例代码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_38234015/article/details/88362021
import java.util.Scanner;
public class Test2_18 {
	public static void main(String[] args) {
		System.out.println("a\tb\tpow(a,b)");
		for(int a = 1; a <= 5; a++) {
			int b = a + 1;
			int pow = (int)(Math.pow(a, b));
			System.out.println(a + "\t" + b + "\t" + pow);
		}
	}
}

猜你喜欢

转载自blog.csdn.net/qq_38234015/article/details/88362021
今日推荐