//我的编译器给出者错误为: // Main.cpp:21:6:错误:对“ greater”的引用不明确 // a = Greater(num1);
#include<iostream>
using namespace std;
string greater(int num)
{
if(num>0)
{
return "Number is Positive";
}
else
{
return "Number is Negative";
}
}
int main()
{
string a;
int num1;
cout<<"Enter a number";cin>>num1;
a = greater(num1);
cout<<a;
}