-
백준 2443번: 별찍기 - 6출력(Print) 2018. 8. 4. 14:50반응형
https://www.acmicpc.net/problem/2443
1. 문제
2. 알고리즘
키워드 - 출력, 구현
3. 코드
12345678910111213141516171819202122232425262728#include <iostream>#include <cstdio>#include <algorithm>#include <vector>#include <functional> // greater 사용 위해 필요#include <string>#include <map>#include <unordered_map>#include <math.h>using namespace std;int main() {ios::sync_with_stdio(false); cin.tie(0); // scanf 안쓸 경우 쓰세요. Cin 사용시int n; cin >> n;for (int i = 0; i < n; i++) {for (int j = 0; j < i; j++) {cout << ' ';}for (int j = i; j < n*2-1-i; j++) {cout << '*';}cout << "\n";}return 0;}cs 반응형'출력(Print)' 카테고리의 다른 글
백준 2523번: 별찍기 - 13 (0) 2018.08.05 백준 2444번: 별찍기 - 7 (0) 2018.08.04 백준 2442번: 별찍기 - 5 (0) 2018.08.04 백준 2804번: 크로스워드 만들기 (0) 2018.07.29 백준 15232번: Rectangles (0) 2018.07.28