Guest User

Untitled

a guest
Jan 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public static void main(String[] args) {
  2.  
  3. Scanner sc=new Scanner(System.in);
  4. String A=sc.next();
  5. String B=sc.next();
  6. int addition = A.length() + B.length();
  7. int number1 = 0;
  8. int number2 = 0;
  9. 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"};
  10. for (int j = 0; j < 25; j++) {
  11. if (A.substring(0) == Alphabet[j]){
  12. number1 = j;
  13. break;
  14. }
  15. }
  16. for (int j = 0; j < 25; j++) {
  17. if (B.substring(0) == Alphabet[j]){
  18. number2 = j;
  19. break;
  20. }
  21. }
  22. if (number1 > number2) {
  23. System.out.println("Yes");
  24. }
  25. else {
  26. System.out.println("No");
  27. }
  28. }
Add Comment
Please, Sign In to add comment