/* Note:Your choice is C IDE */
#include "stdio.h"
#define N 30
void main()
{
int i,j,temp,a[N];
printf("Please input class scores:\n");
for(i=0;i<N;i++)
scanf("%d",&a[i]);
for(j=i+1;j<N-1;j++)
for(j=i+1;j<N;j++)
if(a[i]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
printf("class scores other:");
for(i=0;i<N;i++)
{
if(i%6==0)
printf("\n");
printf("%3d",a[i]);
}
}
Cfans丶夏
相关分类