Do while문을 써보자
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num = (int)(Math.random()* 100);
int insertNum;
int count = 0;
System.out.println("숫자를 입력하세요");
do{
insertNum = scanner.nextInt();
count++;
if (insertNum >num){
System.out.println("Down");
}else if(insertNum< num) {
System.out.println("Up");
}
}while(insertNum != num);
System.out.println("정답");
System.out.println(count+"번 시도");
System.out.println(num);
}
Do while 사용을 안해봐서 사용해서 퀴즈를 풀어봤다
do while문의 생김새
do {실행문;
} while(조건식);
유의사항
- while문 작성이 이 조건이 성립 안한다면 (!=) while(insertNum != num);
- do {} while이 한 단위로 whlie(조건식) 후에 세미콜론을 한 번 찍어주자
랜덤 숫자 생성 = Math.random()*숫자크기
ex) Math.random()*100 => 1~100까지의 숫자 생성
SAM을 이용한 Lambda 배포
- API별로 최소한의 기능별로 쪼개서 만들어서 관리를 쉽게 한다!
- Lambda도 aws 웹에서 뿐 아니라 CLI+ IDE등을 통해서 코드 베이스로 생성할 수 있다.
TIL
- 매일같이 실습을 따라가기 벅찰뿐.. that's all
- aws 전문가가 돈을 많이 받는 이유가 있다더라
사용도 어려운데, 이걸 어떻게 만들었지
'TIL WIL' 카테고리의 다른 글
20220603 TIL (0) | 2022.06.07 |
---|---|
20220602 TIL (0) | 2022.06.02 |
20220530 TIL (1) | 2022.05.31 |
WIL 6th (1) | 2022.05.30 |
20220527 TIL (0) | 2022.05.30 |