Created
March 22, 2020 21:25
-
-
Save dan-dm/fce724abcbfc401f806c6b5ad7c68a13 to your computer and use it in GitHub Desktop.
Created with Copy to Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Solution { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("================================"); | |
for(int i = 0; i < 3; i++) { | |
String s1 = sc.next(); | |
int x = sc.nextInt(); | |
int j = 15 - s1.length(); | |
String stringSpaces = ""; | |
do { | |
stringSpaces += " "; | |
j--; | |
} while (j > 0); | |
String intZeros = ""; | |
if (x < 9) | |
intZeros = "00"; | |
else if (x > 9 && x < 99) | |
intZeros = "0"; | |
System.out.println(s1 + stringSpaces + intZeros + x); | |
} | |
System.out.println("================================"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment