1//print and create new line after
2System.out.println("text");
3System.out.println(String);
4//You can use any variable type, not just strings, although
5//they are the most common
6
7//Print without creating a new line
8System.out.print("text");
9System.out.print(String);
1import java.util.Scanner;
2
3public class Solution {
4
5 public static void main(String[] args) {
6 Scanner sc=new Scanner(System.in);
7 System.out.println("================================");
8 for(int i=0;i<3;i++){
9 String s1=sc.next();
10 int x=sc.nextInt();
11 //Complete this line
12 System.out.printf("%-15s%03d%n",s1,x);
13 }
14 System.out.println("================================");
15
16 }
17}
18
1//minus means left alingment, zero before 3 - left zero appending to the integer
2System.out.printf("%-14s %03d\n", s1, x);