30黑马币
最佳答案23:02:28
张开阳 2015/8/13 23:02:28
public class ChartoTree {
public static void main(String[] args) {
String s = "cbxzbvavdvgd";
char[] cha = s.toCharArray();
TreeMap tm = new TreeMap();
for (char c : cha) {
Integer it = tm.get(c);
if (it == null) {
tm.put(c, 1);
} else {
tm.put(c, it + 1);
}
}
Set keys = tm.keySet();
for (Character key : keys) {
Integer ...
| |
| |