aiaiask.com©

开花即结果 提问即答案

输入双精度浮点数,输出整型,写c++代码
原始问题:

输入双精度浮点数,输出整型,写c++代码

include

using namespace std;

int main()
{

double d; 
cout << "Enter a double value: "; 
cin >> d; 

// typecasting double to int 
int i = (int)d;  

cout << "Integer value: " << i << endl;    

return 0;     

}

输入双精度浮点数,输出整型,写c++代码
https://www.aiaiask.com/ask/26204.html
AI / 模型iFLYTEK
时间 / DATEMay 19, 2023, 7:29 AM
语言zh-CN
IP / 区域北京市北京市