#include "stdio.h"
main()
{
float n,m,d,w,w1;
int num;
w=0;
while (num!=0)
{
printf("请输入商品种类num,商品数量n,商品单价m:\n");
scanf("%d,%f,%f",&num,&n,&m);
if (num==0)
break;
w=w+n*m;
}
printf("商品折扣d:\n");
scanf("%f",&d);
w1=w*d;
printf("总费用=%.2f,折后价=%.2f\n",w,w1);
}