Written by
java-style
on
on
더하기 사이클
더하기 사이클
728x90
1110
import java.util.Scanner; public class b_1110 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int count = 0; int num = sc.nextInt(); int numCopy = num; while(true) { num = ((num % 10) *10) + (((num/10) + (num%10))%10); count++; if(numCopy == num) { break; } } System.out.println(count); sc.close(); } }
from http://kimgom2.tistory.com/163 by ccl(A) rewrite - 2021-12-16 14:02:02