func_code_string: #include <bits/stdc++.h>   using namespace std;   char str[1000005];   int ar[1000005];   void solve() {     int n = (int)strlen(str + 1), i, j, ans = 0;     memset(ar, 0, sizeof(ar));     str[0] =  0 ;     for (i = n; i >= 0; i--) {       if (str[i] ==  1 ) {         j = i;         while (str[j] ==  1 ) --j;         if (i - j > 1)           ar[i] = -1, ar[j] = 1, str[j] =  1 ;         else {           int k;           for (k = -~j; k <= i; k++) ar[k] = 1;         }         i = -~j;       }     }     for (i = 0; i <= n; i++)       if (ar[i]) ans++;     printf( %d n , ans);     for (i = 0; i <= n && ans; i++) {       if (ar[i]) {         putchar(~ar[i] ?  +  :  - ), printf( 2^%d n , n - i);         --ans;       }     }   }   int main(void) {     while (~scanf( %s , str + 1)) {       solve();     }     return 0;   }   