表达式的真假是看零和非零,对于负数也是真
如
typedef struct StudentInfo ElementType;
struct StudentInfo
{
char ID[11];
char *name;
double score;
}StuInfo[12]=
{
{"0800301105","JACK",95},
{"0800201505","LUN",85},
{"0400820115","MARY",75.05},
{"0400850122","KATE",78.9},
{"0500201011","LILI",88},
{"0800401105","JACK",96},
{"0600830105","JAN",98.4},
{"0952520012","SAM",75},
{"9721000045","OSCAR",64},
{"0700301105","JACK",97},
{"0458003312","ZOE",68.9},
{"0400830211","BOBI",87.6}
};
void
InsertionSort( ElementType A[ ], int N ) //该函数是插入排序来比较两个结构体
{
int j, P,t;
ElementType Tmp;
for( P = 1; P < N; P++ )
{
Tmp = A[ P ];
for( j = P; (j > 0) &