int a=1;float x=3.5;a=x;//a的值为3cout<<(a*6+x/2-'1')<<endl;//输出双精度型数负29.5
a=x;//a的值为3
这个是浮点型转为整型,去尾巴了。
a*6+x/2-'1'
'1' 对应的ascII的值为 49因此为:3 * 6 + 3.5/2 -1 = 29.5其中转为双精度类型(向高精度自动转型)