#include <stdio.h>
int main()
{float a=2.3;
int b=13;
int c;//这里改成float就不能运行,但用int就输不出小数QAQ
int n=12;
int x=9,y=18;
if(x>=23&&y<5)
{a=a*(1+0.2);
if(n>3){
c=(b+(n-3)*a+1)*2;
printf("总费用为%d",c);}
else{c=b*2;
printf("总费用为%d",c);}
}
else
{if(n>3){
c=(b+(n-3)*a+1)*2;
printf("总费用为%d",c);}
else{c=b*2;
printf("总费用为%d",c);}
}
return 0;}
%d只能输出整型的
float为浮点型,输出是的格式输出用%f