Java Strings Introduction

  • + 0 comments

    import java.io.; import java.util.;

    public class Solution {

    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. */
        int len = A.length()+B.length();
        String s = "No";
        if(A.compareTo(B)>0){
            s = "Yes";
        }
        String capA = A.substring(0,1).toUpperCase();
        String capB = B.substring(0,1).toUpperCase();
        System.out.printf("%d\n%s\n%s %s", len,s,capA+A.substring(1),capB+B.substring(1));
        sc.close();
    }
    

    }