#include <iostream>
using namespace std;
int main()
{
cout << "Hello World\n";
int x = 50;
int y = 12;
cout << x / y << endl;
cout << (float) (x / y) << endl;
cout << (double) (x / y) << endl;
cout << (double) x / (double) y << endl;
return 0;
}
C/C++ int运算结果转float/double 保留小数
猜你喜欢
转载自blog.csdn.net/u013288190/article/details/127119183
今日推荐
周排行