我想要数组元素的平方根,但输出太错误了!!!你能帮忙纠正我的错误吗???如何将数组更改为 100 大小?
#include <math.h>
#include <iostream>
using namespace std;
// function declaration:
double sqrootx(int arr[], int size);
int main ()
{
// an int array with 5 elements.
double balance[5] = {1000, 2, 3, 17, 50};
double sqr;
// pass pointer to the array as an argument.
sqr= pow( balance, 5 ) ;
// output the returned value
cout << " result" << sqr << endl;
return 0;
}