Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner sc=new Scanner(System.in);
- String A=sc.next();
- String B=sc.next();
- int addition = A.length() + B.length();
- int number1 = 0;
- int number2 = 0;
- String[] Alphabet = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
- for (int j = 0; j < 25; j++) {
- if (A.substring(0) == Alphabet[j]){
- number1 = j;
- break;
- }
- }
- for (int j = 0; j < 25; j++) {
- if (B.substring(0) == Alphabet[j]){
- number2 = j;
- break;
- }
- }
- if (number1 > number2) {
- System.out.println("Yes");
- }
- else {
- System.out.println("No");
- }
- }
Add Comment
Please, Sign In to add comment