int i = 30; int p = 0.7f * i; printf("p is %d\n", p);
在vc ++ 2008 Express上给出20而不是21?我知道这是一个旧的编译器!
float
乘以30会得到一个略低于21的数字,并通过截断将其转换为int会产生20。
int