백준1110번1 [백준 1110번 - java] 더하기 사이클 https://www.acmicpc.net/problem/1110 내 답안 import java.io.IOException; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner s = new Scanner(System.in); int first = s.nextInt(); int N = first; int cnt = 0; while(true) { N = (10 * (N%10)) + ((N/10) + (N%10))%10; cnt++; if (first == N) break; } System.out.println(cnt); } } 2021. 11. 4. 이전 1 다음