C++ 我能';我无法从我的C++;程序

C++ 我能';我无法从我的C++;程序,c++,c++11,C++,C++11,我使用的是在线编译器(运行windows 8,无法让任何其他编译器工作)。我的代码运行、编译并完成,但不起作用。它应该向用户询问风速和温度,将它们放入计算风寒的公式中,对它们进行四舍五入(使用“自制”的四舍五入函数),然后输出答案。但它什么也没给我 谢谢你的帮助 #include <iostream> #include <cmath> using namespace std; int input (int wspeed, int tempature); int calc

我使用的是在线编译器(运行windows 8,无法让任何其他编译器工作)。我的代码运行、编译并完成,但不起作用。它应该向用户询问风速和温度,将它们放入计算风寒的公式中,对它们进行四舍五入(使用“自制”的四舍五入函数),然后输出答案。但它什么也没给我

谢谢你的帮助

#include <iostream>
#include <cmath>
using namespace std;

int input (int wspeed, int tempature);
int calculate (int tempature, int wspeed, int windChill);
int trunkate (int windChill, double wchill);
int output (int tempature, int wspeed, int windChill);
int advisoryWarning (int windChill);


int main() 
{
int wspeed=0, tempature=0, windChill=0;
double wchill=0;
int input (int& wspeed, int& tempature);
int calculate (int& tempature, int& wspeed, int& windChill);
int trunkate (int& windChill, double& wchill);
int output (int& tempature, int& wspeed, int& windChill);
int advisoryWarning (int& windChill);
return 0;
}

int input (int& wspeed, int& tempature)
{
cout<<"This is the input function\nPlease input the tempature outside in fahrenheit."<<endl;
cin>>tempature;
cout<<"Please input wind speed in miles per hour."<<endl;
cin>>wspeed;

if(tempature<-40||tempature>40)
{
    cout<<"Please input a valid tempature between -40 and 40"<<endl;
    cin>>tempature;
}

if(wspeed<0||wspeed>60)
{
    cout<<"Please input a valid wind speed between 0 and 60 mph"<<endl;
    cin>>wspeed;
}
return 0;
}

int calculate (int& tempature, int& wspeed, double& wchill)
{
cout<<"\nThis is calculating\n";
wchill=35.74+0.6215*(tempature)-35.75*(pow(wspeed, 0.16))+0.4275*tempature*pow(wspeed, 0.16);
return wchill;
}

int trunkate (int& windChill, int& wchill)
{
//This is the round function
cout<<"\nThis is the trunkator function\nThis is the exact answer: " << wchill<<endl;
if(wchill<0)
    wchill=wchill-0.5;
else
    wchill=wchill+0.5;
cout<<"this is windchill plus or minus a half: "<<wchill<<endl;
windChill=wchill;
cout<<"this is the final answer: "<<windChill<<endl;
return windChill;
}

int output (int& tempature, int& wspeed, int& windChill)
{
cout<<"\nthis is the output function\n";
cout<<"Tempature entered: "<<tempature<<endl<<"Wind Speed entered: "<<wspeed<<endl<<"Wind Chill: "<<windChill<<endl<<endl;
cout<<"Calling the advisory output function...";
return 0;
}

int advisory (int& windChill)

{
if(windChill<-50)
    cout<<"Life threatening: Fostbite can occur within 5 minutes.";
else if (windChill<-30)
    cout<<"Danger: Frostbite can occur within 10 minutes.";
else if (windChill<-15)
    cout<<"Warning: Frostbite can occur within 30 minutes.";
else if (windChill<20)
    cout<<"Advisory: Frostbite can occur with extended exposure.";
else if (windChill<40)
    cout<<"Notice: Wear cold weather clothing as needed for comfort.";
else
    cout<<"No significant cold weather risk.";
return 0;
}
#包括
#包括
使用名称空间std;
输入(输入速度、温度);
int计算(int温度、int速度、int风冷);
内树干(内风寒,双坡);
int输出(int温度、int速度、int风冷);
int advisoryWarning(int windChill);
int main()
{
int wspeed=0,temputure=0,windChill=0;
双wchill=0;
int输入(int&wspeed、int&temputure);
int计算(int和温度、int和wspeed、int和windChill);
内景干线(内景和风寒、双人和wchill);
int输出(int&temputure、int&wspeed、int&windChill);
int advisoryWarning(int和windChill);
返回0;
}
int输入(int&wspeed、int&temputure)
{
库特
我为您修复了主函数。当您调用其他函数时,您不会调用该函数的类型。当您使一个函数调用

int function(){}
int只是返回类型,调用另一个函数时,只需添加函数名,在int main中,只需调用using function()


希望这有帮助。我不太擅长解释。

请重新检查你的课程/教程/书籍。你的主函数包含一系列函数声明。你没有调用任何函数。你没有这样调用函数:
int-input(int&wspeed,int&temputure);
为什么要通过引用传递所有那些糟糕的
int
s?如果你想要一个例子,看看你是如何在代码中调用
pow
函数的:
pow(wspeed,0.16)
这看起来像你调用自己函数的方式吗?你看到
pow(double wspeed,double 0.16)了吗
?特别是非常量引用,然后不修改它们,当我想要传递临时引用时会发生什么?
int function(){}