#include<stdio.h>#include<string.h>int num[2000];int count;intget_next(int x){int a, b, n;char s[10];sprintf(s,"%d", x);//转化为字符串
n =strlen(s);for(int i =0; i < n -1; i++)//冒泡排序{for(int j = i +1; j < n; j++){if(s[i]> s[j]){char t = s[i];
s[i]= s[j];
s[j]= t;}}}sscanf(s,"%d",&b);//将排序好的字串写入bfor(int i =0; i < n /2; i++)//字符串反转{char t =s[i];
s[i]= s[n - i -1];
s[n - i -1]= t;}sscanf(s,"%d",&a);//将排序好的字串写入areturn a - b;}intmain(){scanf("%d",&num[0]);printf("%d", num[0]);
count =1;while(1){
num[count]=get_next(num[count -1]);printf(" -> %d", num[count]);int found =0;for(int i =0; i < count; i++){if(num[i]== num[count]){
found =1;break;}}if(found){break;}
count++;}return0;}
#include&lt;stdio.h&gt;#include&lt;string.h&gt;int num[2000];int count;int get_next(int x){ int a, b, n; char s[10]; sprintf(s, "%d", x);//转化为字符串 n = strlen(s); for (int i = 0; i &lt; n - 1;...