#include
int main()
{
float hour;
printf("How many hours did you excise?\nPlease input it ^_^ :");
scanf("%f",&hour); //输入函数中“”内不能加\n;
bool a,b;
a=hour>=0.5;
b=hour<=1;
if(a&&b)//判断时候,因为a和b本身就是Bool型,直接用自身就行
printf("Congratulations!You've had a perfect day!\n");
else if(a&&!b)
printf("You are too tired!please have a rest!\n");
else if(!a)
printf("You did not finish your excise,please keep doing it!\n");
return 0;
}
补充的问题在具体点