-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay10s1.java
More file actions
28 lines (23 loc) · 1.06 KB
/
Day10s1.java
File metadata and controls
28 lines (23 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.io.*;
import java.util.*;
public class Day10s1 {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner scanner = new Scanner(System.in);
String A = scanner.nextLine();
String B = scanner.nextLine();
scanner.close();
// İlk satır: A ve B'nin uzunlukları toplamı
System.out.println(A.length() + B.length());
// İkinci satır: A, B'den leksikografik olarak büyükse "Yes", değilse "No"
if (A.compareTo(B) > 0) {
System.out.println("Yes");
} else {
System.out.println("No");
}
// Üçüncü satır: Her iki stringin ilk harflerini büyük yapıp, boşlukla ayırarak yazdır
String capitalizedA = A.substring(0, 1).toUpperCase() + A.substring(1);
String capitalizedB = B.substring(0, 1).toUpperCase() + B.substring(1);
System.out.println(capitalizedA + " " + capitalizedB);
}
}