There are three lines of output: For the first line, sum the lengths of A and B. For the second line, write Yes if A is lexicographically greater than B otherwise print No instead. For the third line, capitalize the first letter in both A and B print them on a single line, separated by a space.


CSZONE
import java.io.*;
import java.util.*;
public class Solution {  
    public static String  capitalize(String str){
        if(str == null ){
            return str;
        }else{
            return str.substring(0,1).toUpperCase()+ str.substring(1).toLowerCase();
        }
    }
    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);
        String A=sc.next();
        String B=sc.next();
        /* Enter your code here. Print output to STDOUT. */
        System.out.println( A.length()+B.length());
        if(A.compareTo(B)>0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        System.out.println(capitalize(A)+" "+capitalize(B));
    }

}







Comments

  1. https://drive.google.com/file/d/17H-PJn3Bhbnar8j9rf7KTjM-vXt6VYXu/view?usp=drivesdk

    ReplyDelete

Post a Comment

Popular posts from this blog

HTML Signup Login Form With Source Code