We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4914fc3 commit b616162Copy full SHA for b616162
src/Main.java
@@ -2,7 +2,15 @@ public class Main {
2
3
public static void main(String[] args) {
4
for (int i = 0; i < 20; i++) {
5
- System.out.println("Hello " + args[0] + "!");
+ System.out.println(pad(i+1, 2)+") Hello " + args[0] + "!");
6
}
7
8
+
9
+ private static String pad(int number, int places) {
10
+ if(String.valueOf(number).length() < places) {
11
+ return String.format("%0"+places+"d", number);
12
+ }
13
14
+ return String.valueOf(number);
15
16
0 commit comments