float类型
#include<stdio.h>int main(void.h);
{
const float revenue_per_150=4.5f;
unsigned short jasold=23500;
unsigned short febsold=19300;
unsigned short marsold=21600;
float revquarter=0.0f;
unsigned long quartersold=jansold+febsold+marsold;
printf("stock sold in\njan:%d\nfeb:%d\nmar:%d\n",jansold,febsold,marsold);
revquarter=quartersold/150*revenue_per_150;
prinft("sales revenue this quarter is:$%.2f\n",revquarter);
return 0
}
为什么输出值会是1930.50 而不是1932