c#中假设10个整数用一个一维数组存放 求其最大值和次大值

日期:2012-03-19 22:56:41 人气:2

c#中假设10个整数用一个一维数组存放 求其最大值和次大值

int[] num = new int[10]{1,2,3,4,5,6,7,8,9,10}; int temp; for (int i = 0; i < 10-1; i++) { for (int j = 0; j < 10 - 1 - i; j++) { if (num[j] > num[j + 1]
    A+
热门评论