#include<stdio.h> int turnover(int dec){ int newd = 0; while(dec > 0){ newd =newd * 10 + dec % 10; dec /= 10; } return newd; } int isOrNot(int dec){ int newd = turnover(dec); if(dec == newd) return 1; else return 0; } int main(){ int l, num, step; scanf("%d", &l); for(int i = 0; i < l; i++){ step = 0; scanf("%d", &num); while(isOrNot(num) != 1){ int newd = turnover(num); num += newd; step++; if(step > 8){ step = 0; break; } } printf("%d\n", step); } return 0; }
0.0分
0 人评分