源程序:
#include <iostream>
#include <cmath>
using namespace std;
int f(int);
int main()
{
int i;
for (i = 0; i < 3; i++)
cout << f(i) << endl;
system("pause");
return 1;
}
int f(int a)
{
int b = 0, c = 1;
b++;
c++;
return int(a + pow(double(b), 2) + c);
}
运行结果: