标签:
任意给出两个英文字母,比较它们的大小,规定26个英文字母A,B,C.....Z依次从大到小。
3 A B D D Z C
A>B D=D Z<C
package acm03;
import java.util.Scanner;
class Main3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String str;
int n = scan.nextInt();
scan.nextLine();
while (n-- > 0) {
str = scan.nextLine();
char first = str.charAt(0);
char second = str.charAt(2);
if (first > second) {
System.out.println(first + "<" + second);
} else if (first == second) {
System.out.println(first + "=" + second);
} else {
System.out.println(first + ">" + second);
}
}
}
}
标签:
原文地址:http://www.cnblogs.com/airycode/p/5509062.html