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