自考新教材-p60_3

源程序:

#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);
}

运行结果:

原文地址:https://www.cnblogs.com/duanqibo/p/12268561.html