一个C++的例题,能否有人给解释一下?自定义的两个函数不太明白什么意思?
#include <stdio.h>
#include <iostream.h>
const int K(5), N(6);
int sum_of_powers(int k,int n),int powers(int m,int n);
void main()
{
cout<<"sum of"<<K<<"powers of integers from 1 to"<<N<<"=";
cout<<sum_of_powers(K,N)<<endl;
}
int sum_of_powers(int k,int n);
{
int sum(0);
for (int i(1);i<=N;i++)
sum+=powers(i,K);
return sum;
}
int powers(int m,int n);
{
int product(1);
for(int i(1);i<=n;i++)
product*=m;
return product;
}