Reading different types of data

 Reading different types of data


Problem Description

Read different types of data from standard input, process them as shown in output format and print the answer to standard output.


Input format:

First line contains integer N.

Second line contains string S.


Output format:

First line should contain N x 2.

Second line should contain the same string S.


Constraints:

0N10

1|S|15 where |S|= length of string S


Solutions;


import java.util.Scanner;

import java.io.*;

public class TestClass {

 public static void main(String[] args) { 

Scanner sc= new Scanner(System.in); 

int a= sc.nextInt();

String b= sc.next();

   int Mul= a*2;

System.out.println(+Mul);  

   System.out.println("" +b+ "");  

     }

}

Post a comment

0 Comments