[정올] Language Coder_반복제어문3_형성평가9_code148 (C)

두비니

·

2020. 4. 10. 01:06

 

 

 

#include <stdio.h>

int main() {

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n-1; i++) {
		for (int j = 0; j <= i; j++) {
			printf("# ", j + 1);
		}
		printf("\n");
	}
	for (int i = n; i >= 0; i--) {
		for (int j = 0; j < n-i; j++) {
			printf("  ");
		}
		for (int j = 0; j < i; j++) {
			printf("# ", j+1);
		}
		printf("\n");
	}


	return 0;
}