Albert_Peng @ 2024-11-23 14:47:04
代码大概就是酱紫的:
#include <bits/stdc++.h>
using namespace std;
freopen ("range.in", "r", stdin);
freopen ("range.out", "w", stdout);
int n, k, corpse [10009];
int main () {
scanf ("%d %d", &n, &k);
for (int i = 0; i < n; i ++) {
scanf ("%d", corpse [i]);
corpse [i] = abs (corpse [i]);
}
sort (corpse, corpse + n);
printf ("%d", corpse [k]);
return 0;
}
求助!!!
by __Function__ @ 2024-11-23 14:50:17
@Albert_Peng@Albert_Peng@Albert_Peng
去掉freopen
by Garbage_fish @ 2024-11-23 14:54:32
scanf ("%d", &corpse[i]);
或
scanf ("%d", corpse + i);
by Msents @ 2024-11-23 15:02:08
@Grammar__hbw
by strcmp @ 2024-11-23 15:04:08
精神状态太美丽了这代码
by Albert_Peng @ 2024-11-23 15:05:39
@Garbage_fishAC 了,感谢