为何输出完成后会自动换行?
public static void sortGrade(int[] a){
Arrays.sort(a);
int k=3;
for(int i = a.length-1 ;i>=0 && k>0 ; i--)
{
if (a[i] >= 0 && a[i] <= 100)
{
System.out.println(a[i] + " ");
k--;
}
}
}
public static void sortGrade(int[] a){
Arrays.sort(a);
int k=3;
for(int i = a.length-1 ;i>=0 && k>0 ; i--)
{
if (a[i] >= 0 && a[i] <= 100)
{
System.out.println(a[i] + " ");
k--;
}
}
}
2016-02-01
举报