void main()
{
int numTickets;
float discount;
float total = 0.0;
int numKids = 0;
float ticketPrice = 19.00;
printf("Enter number of tickets: ");
scanf("%d", &numTickets);
if (numTickets > 10)
{
discount = 0.15;
}
else
{
discount = 0.0;
}
printf("Enter number of children: ");
scanf("%d", &numKids);
total = numKids*ticketPrice/2.0 + (numTickets – numKids)*ticketPrice;
total = total*(1.0 – discount);
printf("Total = %.2f \n", total);
}
基本上,我正在帮助我表弟学习,其中一个问题是为此绘制流程图。问题是我忘记了我所知道的关于流程图的一切!顶部的变量减速有标准吗?实际上,我可以弥补其余的部分,只是不知道如何开始!