#include <stdio.h>
#include <string.h>
typedef struct
 {char name[15];
float cost; int kol;}toy;
int main()
{toy mas[10];
int i,n=-1;
char st[15];
while((puts("input toy name or end"),
scanf("\n%s",st),strcmp(st,"end")!=0)&&(n<9))
{n++;
strcpy(mas[n].name,st);
printf("input cost kol  ");
scanf("%f %d",&mas[n].cost,&mas[n].kol);
}
float sumcost=0,maxcost=0;
st[0]='\0';
puts("=====    massiv of toys   ========");
puts(" N        name     cost       kol ");
puts("==================================");
for(i=0;i<=n;i++)
{
printf("%3d   %10s",i+1,mas[i].name);
printf(" %6.2f  %5d\n",mas[i].cost,mas[i].kol);
sumcost=mas[i].cost*mas[i].kol;
if (sumcost>maxcost) {
maxcost=sumcost;
strcpy(st,mas[i].name);
}
}
printf("tovar %10s Have maxcost= %8.3f\n",st,maxcost);
return 0;
}
