-
알고리즘과 입출력_백준_10991Algorithm 2018. 8. 14. 12:581234567891011121314151617181920212223242526#include <iostream>using namespace std;int main() {int num;bool isStar= true;cin >> num;for (int i = 1; i <= num; i++) {for (int j = 1; j <= num - i; j++) {cout << " ";}for (int j = 1; j <= 2 * i - 1; j++) {if (isStar) {cout << "*";isStar = false;}else {cout << " ";isStar = true;}}isStar = true;cout << endl;}}
cs 'Algorithm' 카테고리의 다른 글
알고리즘과 입출력_백준_2522 (0) 2018.08.14 알고리즘과 입출력_백준_10992 (0) 2018.08.14 알고리즘과 입출력_백준_2445 (0) 2018.08.14 알고리즘과 입출력_백준_11721 (0) 2018.08.14 알고리즘과 입출력_백준_11720 (0) 2018.08.14