aktivita 3
This commit is contained in:
parent
751664869a
commit
e148a5b9ea
19
a3/program.c
19
a3/program.c
@ -1,8 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define MAX 20
|
||||
int main() {
|
||||
//int l = i * 2 + 1;
|
||||
//int r = i * 2 + 2;
|
||||
int i, t ,n;
|
||||
int *a = calloc(MAX, sizeof(int));
|
||||
int *m = calloc(MAX, sizeof(int));
|
||||
scanf("%d", &n);
|
||||
for (i = 0; i < n; i++) {
|
||||
scanf("%d", &a[i]);
|
||||
}
|
||||
//m = buildmaxheap(a, n);
|
||||
printf("The heap is\n");
|
||||
for (t = 0; t < n; t++) {
|
||||
printf("%d\n", m[t]);
|
||||
}
|
||||
|
||||
int i;
|
||||
int l = i * 2 + 1;
|
||||
int r = i * 2 + 2;
|
||||
return 0;
|
||||
}
|
BIN
a3/program.exe
BIN
a3/program.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user