public class shuzu {
public static void main(String[] args) {
int a[]= {11,22,5,9,8,79,42,51,13,69};
//从小到大进行排序
for(int j=0;j<10;j++)
for(int k=0;k<9-j;k++)
if(a[k]>a[k+1])
{
int t;
t=a[k];
a[k]=a[k+1];
a[k+1]=t;
}
System.out.print("排序后的顺序是:");
for(int m=0;m<10;m++)
System.out.print(" "+a[m]);
System.out.print("\n");
//输出素数
System.out.print("素数的值为:");
for(int i=0;i<10;i++)
{if(a[i]==0 && a[i]==1)
continue;
else if(a[i]/2>1 && a[i]%2==0)
continue;
else if(a[i]/3>1 && a[i]%3==0)
continue;
else if(a[i]/5>1 && a[i]%5==0)
continue;
else if(a[i]/7>1 && a[i]%7==0)
continue;
else
System.out.print(" "+a[i]);
}
System.out.println();
}
}