1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include<cstdio> void print_star(int n) { for (int i=1; i<=n; i++) printf("* "); } int main(void) { int n; scanf("%d", &n); for(int i=1; i<=n; i++) { for(int j=n-i; j>=1; j--) printf(" "); print_star(i); printf("\n"); } return 0; } | cs |
'백준 1 > 기초' 카테고리의 다른 글
| [백준 10886] 0 = not cute / 1 = cute (C++/Python) (0) | 2020.12.05 |
|---|---|
| [백준 10992] 별 찍기 - 17 (C++) (0) | 2020.12.05 |
| [백준 1157] 단어 공부 (C++/Python) (0) | 2020.12.05 |
| [백준 2675] 문자열 반복 (C++/Python) (0) | 2020.12.05 |
| [백준 1152] 단어의 개수 (C++/Python) (0) | 2020.12.05 |