题目:下列程序的运行结果是: public class Test{ public static void main(String args[ ]){ int temp ; int a[ ] = {7,2,1,4,8,9,5,3,6,7}; for ( int i = 0 ; i < a.length-1; i ++ ){ for (int j = i+1 ; j < a.length ; j++ ){ if ( a[j] temp =a[i]; a[i] = a[j]; a[j] = temp; } } } for (int i =0 ; i System.out.print (a[i]+" "); } }
A. 9,8,7,7,6,5,4,3,2,1
B. 1,2,3,4, 5,6,7,7,8,9
C. 9 8 7 7 6 5 4 3 2 1
D. 1 2 3 4 5 6 7 7 8 9
答案:评论后可见此内容