#include <iostream>
#include <cmath>
using namespace std;
double T;
double V;
double WC(double T, double V);
void index(double WC(double T, double V));
int main(void)
{
cout<<"Please enter your T followed by your V"<<endl;
cin>>T>>V;
cout<<index;
}
double WC(double, double)
{
if(V>4.8)
return 13.12+0.6215*T-11.37*pow(V,0.16)+0.3965*T*pow(V,0.16);
else
return T;
}
void index(double WC(double,double))
{
if (WC(T,V)<=0&&WC(T,V)>=-25)
{
cout<<"Discomfort";
}
if (WC(T,V)<-25&&WC(T,V)>=-45)
{
cout<<"Risk of skin freezing (frostbite)";
}
if (WC(T,V)<-45&&WC(T,V)>=-60)
{
cout<<"Exposed skin may freeze within minutes";
}
if (WC(T,V)<-60)
{
cout<<"Exposed skin may freeze in under 2 minutes";
}
}
我不明白为什么这会输出像“010F11B8”这样的随机乱码,它只应该根据输入的温度和风速打印一些东西。