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 | 31 |
Tags
- retry
- 오라클
- PL/SQL
- 쿼리
- MVC
- Spring
- aws
- 디자인 패턴
- Intellj
- db
- MST
- 자바
- 페이징
- 클라우드
- Spring Boot
- Kafka
- 알고리즘
- Jenkins
- 데이터베이스
- feign
- 자료구조
- Spring Cloud Feign
- 코딩
- DP
- SQL
- 운영체제
- JPA
- Spring Cloud
- golang
- 백준
Archives
- Today
- Total
justgo_developer
[JAVA] 백준 1094 막대기 본문
import java.util.Scanner;
public class Main {
private static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int bar = 64;
int x = sc.nextInt();
int cnt=0;
while(x!=0){
if(bar>x){
bar=bar/2;
}
else{
x=x-bar;
cnt++;
}
}
System.out.print(cnt);
}
}