比大小

判断两个数的大小关系

http://www.nowcoder.com/questionTerminal/f05358b9e8164b27871c87d3097f4dab

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String[] s = sc.nextLine().split(" ");
            int a = Integer.parseInt(s[0]);
            int b = Integer.parseInt(s[1]);
            char c = '=';
            if(a > b) c = '>';
            if(a < b) c = '<';
            System.out.printf("%d%c%d\n", a, c, b);
        }
    }
}
全部评论

相关推荐

1 收藏 评论
分享
牛客网
牛客企业服务