#include <stdio.h>
#include <stdlib.h>
struct Students
{
char name[20];
double grade1;
double grade2;
double total;
double average;
int rank;
};
void total(struct Students *stu)
{
int i;
for(i=0;i<5;i++){
stu[i].total=stu[i].grade1+stu[i].grade2;
}
}
void average(struct Students *stu)
{
int i;
for(i=0;i<5;i++){
stu[i].average=(stu[i].grade1+stu[i].grade2)/2.0;
}
}
void rank(struct Students *stu)
{
int i,j,flag;
for(i=0;i<5;i++)
{
flag=1;
for(j=0;j<5;j++)
if(stu[j].average>stu[i].average)
flag++;
stu[i].rank=flag;
}
}
int main()
{
int i;
struct Students *p;
struct Students