티스토리 뷰
public class Q14 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("사각형을 출력합니다");
System.out.print("단 수 : ");
int a = scanner.nextInt();
for (int i = 1; i <= a; i++) {
for (int j = 1; j <= a; j++){
System.out.print("*");
}
System.out.println();
}
}
}
(1)
public class Square_01_14 {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int n;
System.out.println("정사각형 모양으로 나타냅니다.");
do {
System.out.print("단수는:");
n = stdIn.nextInt();
} while (n <= 0);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++)
System.out.print('*');
System.out.println();
}
}
}
(2)
※참조
Do it! 자료구조와 함께 배우는 알고리즘 입문
'PS > etc' 카테고리의 다른 글
chapter1) 피라미드 별 찍기 (0) | 2020.07.07 |
---|---|
chapter1) 직각 이등변 삼각형 별찍기 (0) | 2020.07.06 |
chapter1) 덧셈표 작성 (0) | 2020.07.06 |
chapter1) 곱셈표 작성 (0) | 2020.07.06 |
chapter1) 양의 정수 자릿수 구하기 (0) | 2020.07.06 |
링크
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 프로그래머스
- 백기선 스터디
- http
- JPA 연관관계 매핑
- 이펙티브자바 아이템59
- 이펙티브자바 스터디
- 드림코딩
- 김영한 http
- java
- js promise
- 이펙티브자바 아이템60
- JS 딥다이브
- GCP
- HTTP 완벽가이드
- ㅇㄷㅇㅈ
- 킹수빈닷컴
- 김영한 JPA
- Spring Security
- js array
- BOJ
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- js api
- REST API
- 모던자바스크립트
- 이펙티브자바
- 프로그래머스 SQL
- dreamcoding
- 백준
- HTTP 완벽 가이드
- 패스트캠퍼스 컴퓨터공학 완주반
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함