c++怎样将一个浮点型转化为整型输出??
# include "stdafx.h"# include <iostream.h>
# include <stdlib.h>
int main(int argc, char* argv[])
{
float f = 3.14;
cout << (int)f << endl;
system("pause");
return 0;
}
除了以上的强转方式 还有别的方式吗?
2013-09-26 19:09
2013-09-26 20:25