-
백준 2523번: 별찍기 - 13출력(Print) 2018. 8. 5. 15:57반응형
1. 문제
2. 알고리즘
키워드 - 출력, 구현
3. 코드
123456789101112131415161718192021222324252627282930313233343536373839404142434445#include <iostream>#include <sstream>#include <string>#include <algorithm>#include <functional>#include <vector>#include <list>#include <queue>#include <deque>#include <map>#include <set>#include <stack>#include <math.h>#include <memory.h>using namespace std;#define MAX_SIZE 100#define INF 0x7fffffff#define CENDL "\n"#define ll long longint main() {cin.tie(0);std::ios::sync_with_stdio(false);int n; cin >> n;for (int i=1; i<=n; i++) {for (int j=1;j<=i; j++) {cout << "*";}cout << CENDL;}for (int i=n-1; i>=1; i--) {for (int j=i+1;j>1; j--) {cout << "*";}cout << CENDL;}return 0;}cs 반응형'출력(Print)' 카테고리의 다른 글
백준 2444번: 별찍기 - 7 (0) 2018.08.04 백준 2443번: 별찍기 - 6 (0) 2018.08.04 백준 2442번: 별찍기 - 5 (0) 2018.08.04 백준 2804번: 크로스워드 만들기 (0) 2018.07.29 백준 15232번: Rectangles (0) 2018.07.28