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 sc=new Scanner(System.in); String A=sc.next(); String B=sc.next(); int len_a = A.length(); int len_b = B.length(); int len_sum = len_a + len_b; System.out.println(len_sum); int result = A.compareTo(B); if (result<0){ System.out.println("No"); } else if (result>0) { System.out.println("Yes"); } else{ System.out.println("No"); } String firstletterA = A.substring(0,1); String restofwordA = A.substring(1); String resultA = firstletterA.toUpperCase() + restofwordA; System.out.print(resultA + " "); String firstletterB = B.substring(0,1); String restofwordB = B.substring(1); String resultB = firstletterB.toUpperCase() + restofwordB; System.out.print(resultB); }
}
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 →
import java.io.; import java.util.;
public class Solution {
}