今天去面试,不知道是公司出错题了还是怎么着,怎么看怎么觉的别扭....int a= 20,b = 3,c= 25,d = 30,f = 12,e = 5;
通过大小排序后,输出 a b c d e f(我理解这里是让输出字母的,而不是数字!) 
没分可送....只是让大家看看,如果不想回复,也不怪你们

解决方案 »

  1.   

    看上去没有什么规律,直接就这样写上去吧。
    觉得a,b...在这里只是一个变量呀,我也可以定义aa,bb,..
      

  2.   


             //这个程序不知道是否合适你应聘公司的要求!
             int a= 20,b = 3,c= 25,d = 30,f = 12,e = 5; 
    TreeMap<Integer, Character> set = new TreeMap<Integer, Character>();
    set.put(a, 'a');
    set.put(b, 'b');
    set.put(c, 'c');
    set.put(d, 'd');
    set.put(f, 'f');
    set.put(e, 'e');
    System.out.println(set.values());