#include<stdio.h>

void sort_score(int *);

void main(void)

{

 int result[5][3]

       ={{50,65,45},{77,80,90},{30,40,50},{75,92,80},{65,69,90}};

 

 sort_score(result[0]);

}

 

void sort_score(int *score)

{

 int temp,i,j,k;

 

 for(j=0;j<3;++j){

    for(i=0;i<4;++i){

       for(k=i+1;k<5;++k){

          if(*(score+3*i+j)<*(score+3*k+j)){

             temp=*(score+3*i+j);

             *(score+3*i+j)=*(score+3*k+j);

             *(score+3*k+j)=temp;

          }

        }

    }

 }

 printf("English: ");

 for(i=0;i<5;++i) printf("%d ",*(score+3*i+0));

 printf("\n");

 

 printf("Math: ");

 for(i=0;i<5;++i) printf("%d ",*(score+3*i+1));

 printf("\n");

 

 printf("Japanese: ");

 for(i=0;i<5;++i) printf("%d ",*(score+3*i+2));

 printf("\n");

}