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
|
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num=scanner.nextInt();
int check = num;
int count =0;
while(true) {
check =(check%10)*10+((check/10 +check%10)%10);
count++;
if(num==check)
break;
}
System.out.println(count);
}}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none; color:white">cs |
'알고리즘' 카테고리의 다른 글
백준 10818번 자바(JAVA) (0) | 2019.10.14 |
---|---|
프로그래머스/LEV2 타겟 넘버 자바 (0) | 2019.10.10 |
백준 4344 자바 성공코드 (0) | 2019.06.20 |
백준 15552번 자바 성공코드 (0) | 2019.06.14 |
백준 11721번 자바 성공 코드 (0) | 2019.06.13 |