#include #include #define SWAP(type, a, b) {type tmp=a; a=b; b=tmp;} void Sort(char *arr, int n) { int h=1; for (int h_tmp=1; h_tmp=h && arr[j-h]=0; i--) { if (t!=x[i]) { SWAP(char, x[i], x[i+1]); flg=1; break; } } if (x[0]!='0' && flg) { printf("%s\n", x); } else { printf("-1\n"); } return 0; }