1 #include <stdio.h> 2 #include <string.h> 3 int occur_table[12]={0}; 4 bool fill_table(char *p) 5 { 6 while(*p){ 7 occur_table[(*p)-'0']++; 8 p++; 9 } 10 return 0; 11 } 12 int main() 13 { 14 char ori_num[22]; 15 scanf("%s",ori_num); 16 fill_table(ori_num); 17 int c=0; 18 int i; 19 for(i=strlen(ori_num)-1;i>=0;i--){ 20 int temp=(ori_num[i]-'0')*2+c; 21 ori_num[i]=temp%10+'0'; 22 c=temp/10; 23 } 24 if(c){ 25 printf("No\n"); 26 printf("%d",c); 27 printf("%s\n",ori_num); 28 return 0; 29 } 30 for(i=strlen(ori_num)-1;i>=0;i--){ 31 if(occur_table[ori_num[i]-'0']--<=0){ 32 printf("No\n"); 33 printf("%s\n",ori_num); 34 break; 35 } 36 } 37 if(i!=-1) return 0; 38 printf("Yes\n"); 39 printf("%s\n",ori_num); 40 return 0; 41 }