

这个代码出现了什么问题,我一直运行不了,应该怎么修改一下?想请问一下?
经过验证,代码没问题。
从图片中看,可能是路径中有中文导致的。
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
int a[n];
for (int i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
int max = a[0];
int min = a[0];
int maxs = 0;
int mins = 0;
for (int i = 0; i < n; i++)
{
if (a[i] > max)
{
max = a[i];
maxs = i;
}
if (a[i] < min)
{
min = a[i];
mins = i;
}
}
int temp;
temp = a[0];
a[0] = a[mins];
a[mins] = temp;
temp = a[maxs];
a[maxs] = a[n - 1];
a[n - 1] = temp;
for (int j = 0; j < n; j++)
{
printf("%d ", a[j]);
}
return 0;
}
输出结果:
