日期:2014-05-20 浏览次数:20815 次
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("请输入a:");
int a = in.nextInt();
System.out.print("请输入b:");
int b = in.nextInt();
boolean c;
if (a > b) {
c = true;
System.out.println("比较结果是:c=" + c);
} else {
c = false;
System.out.println("比较结果是:c=" + c);
}
}
int c = a > b ? a : b