250x250
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
- D드라이브생성
- 주사위굴리기2
- 백준15652
- 백준
- 알고리즘개념
- 파티션 크기 조정
- 자바
- 알고리즘
- 백준13458
- 코테
- java
- N과M
- 전화번호속의암호
- 23288
- 백준2251
- 중복순열
- 볼륨 만들기
- 재귀함수
- 정보처리기사
- BFS
- 에라토스테네스의채
- 자바 코테
- 순열
- 중복조합
- 완탐
- 코테준비
- Bfs와DFS
- 완전탐색
- 정올 1620
- 삼성역테
Archives
- Today
- Total
목록더하기사이클 (1)
뚱땅뚱땅
[문제] 백준 1110번 더하기 사이클
* 단계별로 풀어보기: while 문 문제 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int cycle = 0; int tmp = n, sum = 0; while(true) { if(n99) break; sum = (tmp/10) + (tmp%10); tmp = (tmp%10)*10 + (sum%10); cycle++; if(n == tmp) break; } System.out.println(cycle); } }
알고리즘/백준
2021. 1. 19. 14:52