https://web.archive.org/web/20150819064024/http://www.todayhumor.co.kr/board/view.php?table=programmer&no=12810
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int N;
scanf("%d", &N);
char *W, *S;
W = (char*)calloc((2*N-1)+1, sizeof(char));
S = (char*)calloc((N-1)+1, sizeof(char));
memset(W, ' ', (N-1));
memset(S, '*', (2*N-1));
int i=0;
for(i=0; i<2*N-1; i++) {
int x = (i < N) ? i : (2*(N-1) - i);
int w = N - 1 - x;
int s = x * 2 + 1;
printf("%s", W + N-1 - w);
printf("%s\n", S + 2*N-1 - s);
}
free(W);
free(S);
}
왜 안된다고 하시는지 모르겠네요.