백준 1110 자바

    백준 1110 (더하기 사이클)

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x, y, sum, count = 0; int N = scan.nextInt(); int temp = N; // N 대신에 반복문에서 사용할 임시 변수 while(true) { x = temp / 10; y = temp % 10; sum = x + y; temp = (y *= 10) + (sum % 10); count++; if(temp == N) { break; ..