刪除第//11行,第//14結(jié)果變了。
#include <stdio.h>//1
int main()//2
{//3
? ? double money =12? ? ? ;//4?
? ? double cost =11.5? ? ? ?;//5??
? ? printf("小編能不能打車回家呢:");//6?
? ? printf("%c\n",money>=cost?'y':'n');//7
? ? printf("%c\n",(money>=cost)?'y':'n');//8
? ? //9
? ? printf("%c\n",(money>cost)||(money=cost)?'y':'n');//10
? ? printf("%c\n",(money=cost)||(money>cost)?'y':'n');//11
? ? printf("%c\n",((money>cost)||(money=cost))?'y':'n');//12
? ? //13
? ? printf("%c\n",(money>cost)&&(money=cost)?'y':'n');//14
? ? printf("%c\n",(money=cost)&&(money>cost)?'y':'n');//15
? ? printf("%c\n",((money>cost)&&(money=cost))?'y':'n');//16
? ? //17
? ? return 0;//18
}//19
2021-07-23
這樣明顯嗎?
2021-07-22
我?guī)湍闩芰艘幌?,是沒(méi)有問(wèn)題的。第11行刪除前后,跑出來(lái)的結(jié)果都是n。