#include<stdio.h>
int main()
{
int x, y;//x为输入的序号;y为查询目录的价格
printf("1.绿茶\n");//打印序号的名称。
printf("2.可乐\n");
printf("3.芬达\n");
printf("4.矿泉水\n");
printf("5.爆米花\n");
printf("6.瓜子\n");
printf("0.退出\n");
printf("请输入序号查询价格(范围0-6):");
scanf_s("%d", &x);
switch (x)
{
case 1:
y = 4;
printf("绿茶的价格是: %d", y);
break;
case 2:
y = 3.5;
printf("可乐的价格是: %d ", y);
break;
case 3:
y = 3;
printf("芬达的价格是: %d", y);
case 4:
y = 1.5;
printf("矿泉水的价格是: %d", y);
break;
case 5:
y = 5;
printf("爆米花的价格是: %d", y);
break;
case 6:
y = 2.5;
printf("瓜子的价格是: %d", y);
break;
case 0:
printf("退出 ");
}
}