Help me
/* 求解,下面这个代码为什么无法运行*/
#include<stdlib.h>
#include<iostream>
using namespace std;
int getMaxOrMin(int *arr, int count, bool isMax)
{
int temp = arr[0];
for (int i = 1; i < count; i++)
{
if (isMax)
{
if (temp < arr[i])
{
temp = arr[i];
}
}
else
{
if (temp > arr[i])
{
temp = arr[i];
}
}
}
return temp;
}
int main(void)
{
int arr0[5] = { 9,5,4,8,12 };
bool isMax = true;
cin >> isMax;
cout << getMaxOrMin(arr0, 5, isMax);
system("pause");
return 0;
}