-
Notifications
You must be signed in to change notification settings - Fork 0
/
java_output_formatting.java
38 lines (33 loc) · 1 KB
/
java_output_formatting.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Input -> java 100
cpp 65
python 50
Output -> ===============
java 100
cpp 065
python 050
===============
*/
import java.util.Scanner;
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();
System.out.print(s1);
for(int j=1;j<=(15-s1.length());j++)
System.out.print(" ");
if(x<10)
System.out.print("00"+x);
else if(x>=10 && x<=99)
System.out.print("0"+x);
else
System.out.print(x);
System.out.println();
}
System.out.println("================================");
}
}