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
- Kafka
- Jenkins
- 클라우드
- aws
- Spring
- 자료구조
- SQL
- Spring Cloud Feign
- 운영체제
- 오라클
- golang
- 코딩
- JPA
- Intellj
- 디자인 패턴
- 백준
- MVC
- feign
- 자바
- Spring Boot
- 쿼리
- 페이징
- db
- DP
- 데이터베이스
- retry
- PL/SQL
- MST
- Spring Cloud
- 알고리즘
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);
}
}