cpp笔记2:强制类型转换

chamodsd edited 5 年,6 月前

(float)a/b
使用上去语句,即使a,b均为int类型,输出的也会是float;
float(a)/float(b)
同上

Comments