#include <stdio.h>
#include <conio.h>
#include <string.h>
typedef struct
     { char name[10];
       int ball;
     } test;
typedef struct
     { char family[22];
       test results[5];
     }student;
int main()
{student stud[10]; int i,n=0; float avarstud,avarage=0;
 while (puts("Input names, subjects and marks or end"),
        scanf("\n%s",stud[n].family),
        strcmp(stud[n].family,"end")!=0)
   { for (avarstud=0,i=0; i<3; i++)
       { scanf("\n%s %d",stud[n].results[i].name,
                     &stud[n].results[i].ball);
         avarstud+=stud[n].results[i].ball;}
     printf("Average:%s=%5.2f\n",
                             stud[n].family,avarstud/3);
     avarage+=avarstud;
     n++; }
 printf("Group average mark=%5.2f\n",avarage/n/3);
 getch();
 return 0;}
