if-else语句输出菜单C语言程序
- 格式:docx
- 大小:11.72 KB
- 文档页数:1
#include
int main()
{
int iSelection;
printf("**************************\n");
printf("* Please select key: *\n");
printf("* 1.chocolate *\n");
printf("* 2.cake *\n");
printf("* 3.coco-cola *\n");
printf("**************************\n");
printf("Press 1 to 3 to select:\n");
scanf("%d",&iSelection);
if(iSelection==1)
printf("you select chocolate\n");
else if(iSelection==2)
printf("you select cake\n");
else
printf("you select coco-cola\n");
return 0;
}