HDACM1282
水……
import java.util.Scanner;public class Main{
public static void main(String[] args) {Scanner sc = new Scanner(System.in);while (sc.hasNext()) {int n = sc.nextInt();int count = 0;String str = n+"";while (n != rollBack(n)) {count++;n += rollBack(n);str =str +"--->"+n;}System.out.println(count);System.out.println(str);}}public static int rollBack(int num){char c[] = (""+num).toCharArray();int left = 0;int right = c.length-1;while(left <= right){char ch = c[left];c[left] = c[right];c[right] = ch;left++;right--;}String str = "";for (int i = 0; i < c.length; i++) {str += c[i];}return Integer.parseInt(str);}
}