complete 18870.c
This commit is contained in:
@@ -44,17 +44,14 @@ void compress(int N, Honeycomb *arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
qsort(arr, N, sizeof(Honeycomb), compare_loc);
|
qsort(arr, N, sizeof(Honeycomb), compare_loc);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// C11(Clang)에서 런타임에러: 백준 clang에서 qsort가 정렬을 제대로 하지 못하는 문제
|
||||||
int main() {
|
int main() {
|
||||||
int N;
|
int N;
|
||||||
scanf("%d", &N);
|
scanf("%d", &N);
|
||||||
Honeycomb *arr;;
|
Honeycomb *arr;;
|
||||||
if ((arr = (Honeycomb *) calloc(N, sizeof(Honeycomb))) == NULL) {
|
arr = (Honeycomb *) calloc(N, sizeof(Honeycomb));
|
||||||
printf("NULL");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
scanf("%d", &arr[i].x);
|
scanf("%d", &arr[i].x);
|
||||||
arr[i].loc = i;
|
arr[i].loc = i;
|
||||||
Reference in New Issue
Block a user