此代码使程序崩溃,求修改
#include<stdio.h>int max(int n, int str[100])
{
int i,mx;
mx = str[0];
for (i = 1; i < n; i++)
{
if ((str[i] >= mx)==1)
mx = str[i];
}
return max;
}
int main()
{
int i,n,str[100];
scanf_s("%d", &n);
for (i = 0; i < n; i++)
scanf_s("%d", &str[i]);
printf("%d",max(n, str[100]));
}