kingjh120   6년 전

#include<stdio.h>
int main() {
int n, x, i,c=0,a=0,j=0,*d=NULL;
scanf("%d %d", &n, &x);
while (j < n ) {
scanf("%d", &i);
if (i < x) {
d[c] = (int *)malloc(sizeof(int));
d[c] = i;
c++;
}
if (j == n - 1) {
i = 0;
putchar('\n');
while (i < c) {
printf("%d", d[a]);
free(d[a]);
a++;
}
}
j++;
}
return 0;
}


입력은 돼는데 출력이 안돼요 

댓글을 작성하려면 로그인해야 합니다.