結(jié)果是錯的 為什么
#include <stdio.h>
int main()
{
??? float cost1,cost2,cost;
??? int a=9,b=18,k=12;
??? if(0<=a<=5||23<=a<=24)
??? {
??????? cost1=13+1+2.3*1.2*(k-3);
??? }
??? else
??? {
??????? cost1=13+1+2.3*1*(k-3);
??? }
???? if(0<=b<=5||23<=b<=24)
??? {
??????? cost2=13+1+2.3*1.2*(k-3);
??? }
??? else
??? {
??????? cost2=13+1+2.3*1*(k-3);
??? }
??? cost=cost1+cost2;
??? printf("%f",cost);
??? return 0;
}
2019-10-18
k-3不要,就是k