本文介绍了分割操作的提示有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
#include <iostream>
using namespace std;
void main()
{
cout << "== % %= == Temperature Counting of RIPHAH Faisalabad == = % %= ==\n" << endl;
float Fahrenheit, Centigrade, Kelvin;
cout << "Enter value of Fahrenheit Temeperature:";
cin >> Fahrenheit;
cout << "== == = || == == Temperature == == || == == =\n" << endl;
Centigrade=(5/9) * (Fahrenheit - 32);
Kelvin =((5/9) * (Fahrenheit - 32) + 273);
cout << "Temperature in Fahrenheit: " << Fahrenheit<< endl;
cout << "Temperature in Centigrade: " << Centigrade << endl;
cout << "Temperature in Kelvin: " << Kelvin << endl;
cout << "|| ----------------------------------------------------------------- ||" << endl;
system("pause");
}
当我放5/9时,它不能正确运行,当我写 0.55555555555 而不是 的5/9起作用了,这个程序出了什么问题?
when i put 5/9 it doesnt operate correctly and when i write 0.55555555555 instead of 5/9 it works, whats the problem in this program?
SabeelHussain
SabeelHussain
推荐答案
5和9是整数,请尝试5.0/9.0
5 and 9 are integers, try 5.0/9.0
戴夫
这篇关于分割操作的提示有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!