System.out.printf() :
System.out.printf("%d",x); 输出整数
System.out.printf("%4d",x); 输出宽度为4 右对齐
System.out.printf("%-4d",x); 输出宽度为4 左对齐
System.out.printf("%8f",x); 输出宽度为8 右对齐
System.out.printf("%.2f",x); 精确到小数点后2位
System.out.printf("%d",x); 输出整数
System.out.printf("%4d",x); 输出宽度为4 右对齐
System.out.printf("%-4d",x); 输出宽度为4 左对齐
System.out.printf("%8f",x); 输出宽度为8 右对齐
System.out.printf("%.2f",x); 精确到小数点后2位