Created
June 20, 2019 21:15
-
-
Save Canx/6f4176eb9c9d771197ad7e66e140d6a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package asale; | |
import java.text.ParseException; | |
import java.text.RuleBasedCollator; | |
import java.util.Scanner; | |
public class asale { | |
public static void main(String[] args) throws ParseException { | |
Scanner in = new Scanner(System.in); | |
String primera; | |
String segunda; | |
String rules = "< a < b < c < ch < d < e < f < g < h < i < j < k < l < ll < m < n < ñ < o < p < q < r < s < t < u < v < w < x < y < z"; | |
RuleBasedCollator asaleCollator =new RuleBasedCollator(rules); | |
while (in.hasNextLine()) { | |
primera = in.next(); | |
segunda = in.next(); | |
if( asaleCollator.compare(primera, segunda) < 0) | |
System.out.println(primera); | |
else | |
System.out.println(segunda); | |
in.nextLine(); | |
} | |
in.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment