答案
#include <stdio.h>
int main(int argc, const char * argv[]) {
int kLineCount = 30;
for (int i = 0; i < kLineCount; i++) {
for (int j = 0; j < kLineCount - i; j++) {
printf(" ");
}
for (int j = 0; j < 2 * i + 1; j++) {
printf("*");
}
printf("\n");
}
for (int i = kLineCount; i > 0; i--) {
for (int j = kLineCount; j > 0 + i; j--) {
printf(" ");
}
for (int j = 2 * i - 1; j > 0; j--) {
printf("*");
}
printf("\n");
}
return 0;
}