为啥如下程序编译不通过
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int yy;
double x;
x=sqrt(9);
cout << "你好啊" <<f(2) << "\n";
return 0;
}
int f(int xxx)
{
return xxx*100;
}
改成下面形式,把函数f放在main前面就行了呢??
#include <iostream>
#include <cmath>
using namespace std;
int f(int xxx)
{
return xxx*100;
}
int main()
{
int yy;
double x;
x=sqrt(9);
cout << "你好啊" <<f(2) << "\n";
return 0;
} |