<> Address book sorting

<> subject

input n Information about a friend , Include name , birthday , Telephone number , This topic requires writing procedures , Output the address book in order of age . The title ensures that everyone's birthday is different .
Input format :
The first line of input gives a positive integer n(<10). subsequently n that 's ok , Per line “ full name birthday
Telephone number ” Give a friend's information in the format of , among “ full name ” Is not longer than 10 A string of English letters ,“ birthday ” yes yyyymmdd Date in format ,“ Telephone number ” No more than 17 Digit numbers and +,- Composed string .
Output format :
Output the information of friends according to their age , Same format as output .

<> sample input :

3
zhang 19850403 13912345678
wang 19821020 +86-0571-88018448
qian 19840619 13609876543

<> sample output :

wang 19821020 +86-0571-88018448
qian 19840619 13609876543
zhang 19850403 13912345678

<> code
#include<stdio.h> struct ple{ char na[15]; int sh; char num[30]; }; int main ()
{ struct ple g[15]; int n; scanf("%d",&n); for(int y = 0;y < n;y++){ scanf("%s
%d %s",g[y].na,&g[y].sh,g[y].num); } for(int y = 0;y < n-1;y++){ for(int w = y+1
;w < n;w++){ if(g[y].sh > g[w].sh){ struct ple j = g[y]; g[y] = g[w]; g[w] = j;
} } } for(int r = 0;r < n;r++){ printf("%s %d %s\n",g[r].na,g[r].sh,g[r].num); }
return 0; }
Number of questions C The basis of language structure , It is mainly to establish the structure , As for sorting C There are bubble sort and selective sort in language , They all have fixed frames , For this problem, memorizing the framework can solve the problem quickly .

Technology