int[] g = {2, 6, 7, 9, 1};
int x;
for(int b=0; b < g.length-1; b++){
for(int c=1; c<g.length; c++){
if(g[b] >g[c]){
x = g[b];
g[b] = g[c];
g[c] = x;
}
}
}
for(int b=0; b<g.length; b++){
System.out.println(g[b]);
}
代码如上,老是达不到排序的效果,求大神解答。
逝去还是遗忘
鈊鍟
随时随地看视频慕课网APP