怎么把小数输出来(我好菜,学了这么久还不会QAQ)
#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;}