本帖最后由 ゞ导火索゛ 于 2014-6-3 13:35 编辑
- import java.util.*;
- public class fawef {
- public static void main(String[] args) {
-
- int a = 9;
- int b = 10;
- int c = 7;
- Map<Character, Integer> map = new HashMap();
-
- map.put('a', a);
- map.put('b', b);
- map.put('c', c);
- comp(map);
- }
-
- public static void comp(Map<Character, Integer> map){
- int a = map.get('a');
- int b = map.get('b');
- int c = map.get('c');
-
- String str = "";
-
- ///a>b>c a>c>b b>a>c b>c>a c>a>b c>b>a
- if(a>b && a>c)
- {
- if(b>c)
- str = "a>b>c";
- else
- str = "a>c>b";
- }
- if(b>a && b>c)
- {
- if(a>c)
- str = "b>a>c";
- else
- str = "b>c>a";
- }
- if(c>a && c>b)
- {
- if(a>b)
- str = "c>a>b";
- else
- str = "c>b>a";
-
- }
-
- System.out.println(str);
-
- }
- }
复制代码
|