You are viewing a single comment's thread. Return to all comments →
var sc = new Scanner(System.in); String t = ""; for(int i=0;i<3;i++) { String[] a=sc.nextLine().split(" "); String te = a[0]; int x = (int) Double.parseDouble(a[1]); t += te; for(int i1 = te.length(); i1 < 15;i1++){ t += " ";} t += (x > 100)? ""+x : (x < 10)? "00"+x : "0"+x; t += "\n";} System.out.println("================================"); System.out.print(t); System.out.println("================================"); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Output Formatting
You are viewing a single comment's thread. Return to all comments →