试图找到最低分和最高分,我不断收到错误
argument of type "double" is incompatible with parameter of type "double*"
代码:
cout << "The lowest of the results = " << find_lowest(score[5]);
cout << "The highest of the results = " << find_highest(score[5]);
system("Pause");
}
double find_highest(double a[])
{
double temp = 0;
for(int i=0;i<5;i++)
{
if(a[i]>temp)
temp=a[i];
}
return temp;
}
double find_lowest(double a[])
{
double temp = 100;
for(int i=0;i<5;i++)
{
if(a[i]<temp)
temp=a[i];
}
return temp;
}