# 老--质价比

### 老--质价比

Time Limit: 1000MS Memory Limit: 65536KB
Submit Statistic

#### Example Input

`31 2 23 2 3`

#### Example Output

`1 32 32 2`
`#include<stdio.h>struct bijiao{    int zhiliang;    int jiage;}stu[130], stu2;int main(){    int n ,a, b;    struct bijiao *ps;    ps=stu;    while(scanf("%d", &n)!=EOF)    {        for(a=0;a<n;a++)        {            scanf("%d", &(ps+a)->zhiliang);        }        for(a=0;a<n;a++)        {            scanf("%d", &(ps+a)->jiage);        }        for(a=0;a<n;a++)        for(b=0;b<n-a-1;b++)        {            if((ps+b)->zhiliang>(ps+b+1)->zhiliang)            {                stu2=stu[b];                stu[b]=stu[b+1];                stu[b+1]=stu2;            }            else if((ps+b)->zhiliang==(ps+b+1)->zhiliang)            {                if((ps+b)->jiage<(ps+b+1)->jiage)                {                    stu2=stu[b];                    stu[b]=stu[b+1];                    stu[b+1]=stu2;                }            }        }        for(a=0;a<n;a++)        {            printf("%d %d\n", (ps+a)->zhiliang, (ps+a)->jiage);        }    }    return 0;}`

0 0