You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String a = scan.nextLine(); String b = scan.nextLine(); System.out.println(a.length() + b.length()); if (a.compareTo(b) > 0) { System.out.println("Yes"); } else { System.out.println("No"); } String aCapitalized = a.substring(0, 1).toUpperCase() + a.substring(1); String bCapitalized = b.substring(0, 1).toUpperCase() + b.substring(1); System.out.println(aCapitalized + " " + bCapitalized); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Strings Introduction
You are viewing a single comment's thread. Return to all comments →