算法
上士闻道~勤而行之
这个作者很懒,什么都没留下…
展开
-
冒泡排序
public void maopao(){ int[] arr = {45,9,67,23,34}; for(int i = 0;i < arr.length - 1; i++){ System.out.println("比较次数:" + (arr.length - 1 -i)); for(int j = 0;j < arr.length - 1 -i; j++){//每轮...原创 2018-04-06 09:40:50 · 100 阅读 · 0 评论 -
输入一个字符串,然后取出每个字符出现的次数
public static void main(String[] args) { System.out.println("输入一个字符串:"); Scanner in=new Scanner(System.in); String str=in.nextLine(); //存放 Map<Character,Integer> map= new HashMap<...原创 2018-04-07 09:04:25 · 850 阅读 · 0 评论