#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("在一个月黑风高的夜晚,");
printf("一个小男孩用自己的积蓄买了一束花。\n");
printf("(以下是小女生问,男生答)\n");
printf("小女生,你这花多少钱一束啊?\n");
printf("小男生:");
double flowerprice;//鲜花的价格
scanf("%lf\n",&flowerprice);
//小女生的想法
printf("小女生想:");
if (flowerprice > 9999)
{
printf("亲爱的明天我们就结婚吧!\n");
}
else if (flowerprice > 1000 && flowerprice <= 9999 )
{
printf("你真好,亲亲嘴!\n");
}
else if (flowerprice > 500 && flowerprice <= 1000 )
{
printf("你真好,拉拉手!\n");
}
else if (flowerprice > 100 && flowerprice <= 500 )
{
printf("明天在见吧!\n");
}
else
{
printf("呸,穷鬼!\n");
}
/*************************************************
if (flowerprice > 9999)
{
printf("明天就结婚!\n");
}
else if (flowerprice > 1000 && flowerprice <= 9999)
{
printf("拉拉手吧!\n");
}
else if (flowerprice > 500 && flowerprice <= 999)
{
printf("明天再约吧!\n");
}
else
{
printf("呸!\n");
}
*************************************************/
return 0;
}
这段代码的执行结果是:
只能执行到录入花的价格,之后的条件完全无法执行,而且这套语句完全是跟进视频的老师敲出来的, 完全没有报错,哪位大神路过看到帮忙解释一下,谢谢