Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input will contain a string follow by an integer #295

Open
AJAY123-12 opened this issue Dec 10, 2020 · 1 comment
Open

Input will contain a string follow by an integer #295

AJAY123-12 opened this issue Dec 10, 2020 · 1 comment

Comments

@AJAY123-12
Copy link

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("=================="); }
}

@harshitbhomawat
Copy link

what's the issue here is not clear to me. Do you want the code in c++?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants