【5】显示下面表格,将浮点数值类型转换为整数。

package test;

public class test2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		/*
		 * 打印表格
		 * 将浮点数值类型转换为整数
		 */
		System.out.print("a"+"     "+"b"+"     "+"pow(a,b)");
		System.out.println();
		for(int a=1,b=2;a<=5&&b<=6;a++,b++)
		{
			System.out.print(a+"     "+b+"     ");
			System.out.print((int)(Math.pow(a, b)));
			System.out.println();
		}

	}

}

打印表格

相关文章:

  • 2022-01-07
  • 2021-05-29
  • 2021-06-21
  • 2022-01-11
  • 2021-07-16
  • 2021-12-27
  • 2021-09-13
猜你喜欢
  • 2021-09-28
  • 2021-10-13
  • 2021-12-04
  • 2021-12-22
  • 2021-11-19
  • 2021-11-21
  • 2021-12-15
相关资源
相似解决方案