#include<stdio.h>
#define N 3
struct worker
{
int number;
char name[20];
int age;
int slory;
};
void main()
{
struct worker wor[N];
int i,max;
for(i=1;i<=N;i++)
{
printf("number&name:");
scanf("%d,%s",&wor[i].number,wor[i].name);
printf("age&slory");
scanf("%d,%d",&wor[i].age,&wor[i].slory);
}
for(i=0;i<N;i++)
{
if(wor[i].age<wor[i+1].age)
max=wor[i+1].age;
wor[i+1].age=wor[i].age;
wor[i].age=max;
}
printf("%d%s%d%d",wor[i].number,wor[i].name,wor[i].age,wor[i].slory);
}
#define N 3
struct worker
{
int number;
char name[20];
int age;
int slory;
};
void main()
{
struct worker wor[N];
int i,max;
for(i=1;i<=N;i++)
{
printf("number&name:");
scanf("%d,%s",&wor[i].number,wor[i].name);
printf("age&slory");
scanf("%d,%d",&wor[i].age,&wor[i].slory);
}
for(i=0;i<N;i++)
{
if(wor[i].age<wor[i+1].age)
max=wor[i+1].age;
wor[i+1].age=wor[i].age;
wor[i].age=max;
}
printf("%d%s%d%d",wor[i].number,wor[i].name,wor[i].age,wor[i].slory);
}