반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include <iostream> using namespace std; int main() { int num; cin >> num; for (int i = 1; i <= num; i++) { for (int j = 1; j <= num-i; j++) { cout << " "; } for (int t = 1; t <= i; t++) { cout << "*"; } cout << '\n'; } for (int i = 1; i < num; i++) { for (int t = 1; t <= i; t++) { cout << " "; } for (int j = 1; j <= num - i; j++) { cout << "*"; } cout << '\n'; } } | cs |
'Algorithm' 카테고리의 다른 글
(C++) - 백준(BOJ) 2556번 : 별찍기-14 답 (2) | 2016.09.26 |
---|---|
백준(baekjoon)(BaekJoon)코딩 2523번:별찍기-13 답 (0) | 2016.09.26 |
백준(baekjoon)(BaekJoon)코딩 2446번:별찍기-9 답 (0) | 2016.09.26 |
백준(baekjoon)(BaekJoon)코딩 2445번:별찍기-8 답 (0) | 2016.09.26 |
백준(baekjoon)(BaekJoon)코딩 2444번:별찍기-7 답 (0) | 2016.09.26 |