-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjava_output_formatting.java
44 lines (41 loc) · 1.02 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
39
40
41
42
43
44
/*
Input --> java 100
cpp 65
python 50
Output --> ================================
java 100
cpp 065
python 050
================================
*/
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int i,j;
String st;
int n,k;
for(k=1;k<=32;k++)
System.out.print("=");
System.out.println();
for(i=1;i<=3;i++)
{
int l=0;
st=scan.next();
n=scan.nextInt();
l=st.length();
System.out.print(st);
for(j=l;j<15;j++)
System.out.print(" ");
if(n>=0 && n<=9)
System.out.print("00"+n);
else if(n>=10 && n<=99)
System.out.print("0"+n);
else
System.out.print(n);
System.out.println();
}
for(k=1;k<=32;k++)
System.out.print("=");
}
}