1 public class test { 2 public static void main(String [] args){ 3 System.out.println("123456\t前面内容有6位,补2个空格" ); 4 System.out.println("12345678\t前面内容有8位,加8个空格" ); 5 System.out.println("12345678901
1 public class test { 2 public static void main(String [] args){ 3 System.out.println("123456\t前面内容有6位,补2个空格"); 4 System.out.println("12345678\t前面内容有8位,加8个空格"); 5 System.out.println("123456789012345\t前面内容有15位,补1个空格"); 6 } 7 }
参考:https://blog.csdn.net/hju22/article/details/79773252