2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ # [ level 1] 직사각형 별찍기 - 12969
2
+
3
+ [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12969?language=javascript )
4
+
5
+ ### 성능 요약
6
+
7
+ 메모리: 32.1 MB, 시간: 60.16 ms
8
+
9
+ ### 구분
10
+
11
+ 코딩테스트 연습 > 연습문제
12
+
13
+ ### 채점결과
14
+
15
+ 정확성: 100.0<br />합계: 100.0 / 100.0
16
+
17
+ ### 제출 일자
18
+
19
+ 2024년 08월 07일 23:09:37
20
+
21
+ ### 문제 설명
22
+
23
+ <p >이 문제에는 표준 입력으로 두 개의 정수 n과 m이 주어집니다.<br >
24
+ 별(* ) 문자를 이용해 가로의 길이가 n, 세로의 길이가 m인 직사각형 형태를 출력해보세요.</p >
25
+
26
+ <hr >
27
+
28
+ <h5 >제한 조건</h5 >
29
+
30
+ <ul >
31
+ <li >n과 m은 각각 1000 이하인 자연수입니다.</li >
32
+ </ul >
33
+
34
+ <hr >
35
+
36
+ <h5 >예시</h5 >
37
+
38
+ <p >입력</p >
39
+ <div class =" highlight " ><pre class =" codehilite " ><code >5 3
40
+ </code ></pre ></div >
41
+ <p >출력</p >
42
+ <div class =" highlight " ><pre class =" codehilite " ><code >*****
43
+ *****
44
+ *****
45
+ </code ></pre ></div >
46
+
47
+ > 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Original file line number Diff line number Diff line change
1
+ process . stdin . setEncoding ( 'utf8' ) ;
2
+ process . stdin . on ( 'data' , data => {
3
+ const n = data . split ( " " ) ;
4
+ const a = Number ( n [ 0 ] ) , b = Number ( n [ 1 ] ) ;
5
+ const row = '*' . repeat ( a )
6
+
7
+ for ( let i = 0 ; i < b ; i ++ ) {
8
+ console . log ( row )
9
+ }
10
+
11
+ } ) ;
0 commit comments