ettransinfos[j].num;Р }Р } Р }Р printf("%3d\t\t%s\t\t%3d\t\t%3d\t\t%3d\n", pettypes[i].typeId, pettypes[i].name, purchasenum, salenum, purchasenum - salenum);Р?}Р};Рint getcurrenttypeindex()Р{Р?int index=-1;Р?int i;Р?for(i=0;i<SIZE;i++)Р?{Р if(pettypes[i].typeId==0)Р {Р index=i+1;Р break;Р }Р?}Р?return index;Р}Рint getcurrenttransinfoindex()Р{Р?int index = -1;Р?int i;Р?for (i = 0; i<SIZET; i++)Р?{Р if (pettransinfos[i].transId == 0)Р {Р index = i + 1;Р break;Р }Р?}Р?return index;Р}Рint istypeexistsbyId(int typeId)Р{Р?if(typeId<1 || typeId>SIZE || pettypes[typeId-1].typeId==0)Р?{Р return -1;Р?}Р?elseР?{Р return 1;Р?}Р}Рint updatepetstore(int typeId,int num,int recordtype)Р{Р?int count;Р?count=pettypes[typeId-1].petstore;Р?if (recordtype == 1)Р?{Р count += num;Р?}Р?else Р?{Р count -= num;Р?}