补3个零System.out.println(String.format("%03d", 1));补2个零System.out.println(String.format("%02d", 1));简单吧^-^