You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each String will have a maximum of 1010 alphabetic characters, and each integer will be in the inclusive range from 00 to 999999.
Output FormatIn each line of output there should be two columns: The first column contains the String and is left justified using exactly 1515 characters. The second column contains the integer, expressed in exactly 33 digits; if the original input has less than three digits, you must pad your output's leading digits with zeroes.Sample Input
java 100
cpp 65
python 50
SampleOutput
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.format("%-15s%03d\n", s1, x);
} System.out.println("=================="); }
}
The text was updated successfully, but these errors were encountered:
Each String will have a maximum of 1010 alphabetic characters, and each integer will be in the inclusive range from 00 to 999999.
Output FormatIn each line of output there should be two columns: The first column contains the String and is left justified using exactly 1515 characters. The second column contains the integer, expressed in exactly 33 digits; if the original input has less than three digits, you must pad your output's leading digits with zeroes.Sample Input
java 100
cpp 65
python 50
SampleOutput
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.format("%-15s%03d\n", s1, x);
} System.out.println("=================="); }
}
The text was updated successfully, but these errors were encountered: