#include<stdio.h>
int main()
{
int i;
double number; //定义double为什么出错呢
for(i=1;i<=5;i++){
printf("1 appple=3.00yuan\n");
printf("2 pears=2.50yuan\n");
printf("3 oranges=4.10yuan\n");
printf("4 grapes=10.20yuan\n");
printf("Type in number:");
scanf("%lf",&number);
switch (number){
case 1.00:
printf("apple=3.00yuan\n");break;
case 2.00:
printf("pears=2.50yuan\n");break;
case 3.00:
printf("oranges=4.10yuan\n");break;
case 4.00:
printf("grapes=10.20yuan\n");break;
default:
printf("0\nyou are wrong!you are so follish!\n");break;
}
}
return 0;
}
错在哪啊,高手指教下