import java util Scanner public class Elvira public static void main S

 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
29
30
31
32
33
import java.util.Scanner;
public class Elvira {
public static void main(String[] args) {
Scanner scanner = new Scanner (System.in);
String s1 = scanner.nextLine().toLowerCase();
String s2 = scanner.nextLine().toLowerCase();
int len;
if (s1.length() >= s2.length())
len = s2.length();
else
len = s1.length();
boolean pr = true;
for (int i = 0; i < len && pr; i++) {
if (s1.charAt(i) < s2.charAt(i)) {
System.out.println("Первая");
pr = false;
}
if (s1.charAt(i) > s2.charAt(i)) {
System.out.println("Вторая");
pr = false;
}
}
if (pr) {
if (s1.length() == s2.length()) {
System.out.println("Строки одинаковы");
} else if (s1.length() < s2.length()){
System.out.println("Первая");
} else
System.out.println("Вторая");
}
}
}