结构体的话,完全下不了手,用这道题做示范吧
#include <stdio.h>
struct Person
{
char name[20];
long id;
float salary;
};
Person allone[6]={{"jone",12345,339.0},{"david",13916,449.0},{"marit",27519,311.0},
{"jasen",42876,623.0},{"peter",23987,400.0},{"yoke",12335,511.0}};
int main()
{
Person temp;
int i,j;
//write your code here
for (i=0;i<6;i++)
{
printf("%s %ld %.1f\n", allone[i].name, allone[i].id, allone[i].salary);
}
return 0;
}