结果是乱码。变量的格式该怎么该
#define N 4struct menu
{int num;
char name[10];
float dj;
};
main()
{int sum,a,b,x,i;float j,c,d,f;
struct menu men[]={{1,"烧茄子套餐",5.00},
{2,"红烧排骨套餐",8.00},
{3,"西红柿炖牛肉套餐",10.00},
{4,"红焖大虾套餐",12.00}};
{printf("**********欢迎光临渤大食堂**********\n");
printf("\t套餐名\t单价");
{for(i=0;i<4;i++)
printf("%d\t%s\t%f\n",men[i].num,men[i].name,men[i].dj);
}
}
printf("您的餐桌号是:");
scanf("%d",&sum);
printf("您所点套餐是:");
scanf("%d",&a);
i=1;
while(a==men[i].num)
j=men[i].dj;
i++;
printf("份数:");
scanf("%d",&b);
c=b*j;
printf("总金额:%f\n",c);
printf("实付金额:");
scanf("%f",&d);
f=d-c;
printf("找零:%f",f);
}