Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- simulation
- Math
- implement
- Method
- two pointers
- 파이썬
- SQL
- Number Theory
- 자바
- array
- string
- hash table
- 코테
- greedy
- dynamic programming
- 코딩테스트
- Tree
- Data Structure
- Class
- Counting
- Binary Tree
- 구현
- database
- Binary Search
- sorting
- Matrix
- java
- bit manipulation
- Stack
- geometry
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.1] 직사각형 별찍기 본문
1. Input
1) 정수 n
2) 정수 m
2. Output
1) 별(*) 문자를 이용해 가로의 길이가 n, 세로의 길이가 m인 직사각형 형태를 출력
3. Constraint
1) 1 <= n, m <= 1,000인 자연수
4. Example
Input: n=5, m=3 -> Output:
*****
*****
*****
5. Code
1) 첫 코드(2022/??)
import java.util.Scanner;
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
for(int i=0 ; i<b ; i++){ // 세로 m줄
for(int j=0 ; j<a ; j++){ // 가로 n개
System.out.print("*");
}
System.out.println();
}
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.1] 행렬의 덧셈 (0) | 2022.11.22 |
---|---|
[프로그래머스/Lv.1] x만큼 간격이 있는 n개의 숫자 (0) | 2022.11.22 |
[프로그래머스/Lv.1] 소수 만들기 (0) | 2022.11.22 |
[프로그래머스/Lv.1] [1차] 비밀지도 (0) | 2022.11.22 |
[프로그래머스/Lv.1] k번째 수 (0) | 2022.11.22 |