#include<stdio.h> int main(void) { int choice,i; double price; for(i=1;i<=5;i++){//根据题目要求要循环5次 printf("[1]apples 3.00 ");//输出的价格 printf("[2]pears 2.50 "); printf("[3]oranges 4.10 "); printf("[4]grapes 10.20 "); printf("[0]Exit "); printf("Enter choice:"); scanf("%d",&choice); if(choice==0)//当输入选择为0是跳出 break; } return 0; }