标签:ring str [] i+1 static work blog void i++
1 public class HomeWork11 { 2 //选择排序和冒泡排序 3 public static void main(String[] args) { 4 //冒泡排序 5 int[]nums=new int[10]; 6 for (int i = 0; i < args.length-1; i++) { 7 for (int j = 0; j < args.length-i-1; j++) { 8 if (nums[j]>nums[j+1]) { 9 int temp=nums[j]; 10 nums[j]=nums[j+1]; 11 nums[j+1]=temp; 12 } 13 } 14 } 15 //选择排序 16 for (int i = 0; i < args.length; i++) { 17 for (int j = i+1; j < args.length; j++) { 18 if (nums[i]>nums[j]) { 19 int temp=nums[i]; 20 nums[i]=nums[j]; 21 nums[j]=temp; 22 } 23 } 24 } 25 } 26 }
标签:ring str [] i+1 static work blog void i++
原文地址:http://www.cnblogs.com/qq634571685/p/6652590.html