my c++ program is working ambigously.number is automatically changing into hexadecimal..pleease healp
<p>my c++ program is working ambiguously.number is automatically changing into hexadecimal..please help</p>

<pre><code>int main() {
    int t=0;
    cin&gt;&gt;t;
    while(t--)
        {
        int Q;
        string A,B,C;
        cin&gt;&gt;Q;
        cin&gt;&gt;hex&gt;&gt;A;
        cin&gt;&gt;hex&gt;&gt;B;
        cin&gt;&gt;hex&gt;&gt;C;

        string bit_A,bit_B,bit_C;
        bit_A=con(A);
        bit_B=con(B);
        bit_C=con(C);
        int k=0;
       for(unsigned i = 0; i != bit_B.length(); ++i)
               {

           if(bit_B[i]=='0' &amp;&amp; bit_C[i]=='1' &amp;&amp; bit_A[i]=='0'  )
               {

               bit_B[i]='1';
               k++;
               continue;
           }
           if(bit_C[i]=='0')
               {
               if(bit_B[i]=='1')
                   {
                   bit_B[i]='0';
               k++;
               }
               if(bit_A[i]=='1')
                   {
                   bit_A[i]='0';
                   k++;
               }
               continue;
           }
       }
        if(k&gt;Q)
            {
            cout&lt;&lt;"-1";
            continue;
                }

       cout&lt;&lt;"value 0f k is"&lt;&lt;k&lt;&lt;endl;
         for(unsigned i = 0; k&lt;Q &amp;&amp; i != bit_A.length(); ++i)
               {
             if(bit_A[i]=='1' &amp;&amp; bit_B[i]=='1')
                 {
                 bit_A[i]='0';
                 k++;
             }
             if(bit_A[i]=='1' &amp;&amp; bit_B[i]=='0' &amp;&amp; (Q-k)&gt;=2)
                 {
                 bit_A[i]='0';
                 bit_B[i]='1';
                 k++;
                 k++;
             }
         }


         }



        cout&lt;&lt;std::uppercase&lt;&lt;hex&lt;&lt;todeci(bit_A)&lt;&lt;endl;
        cout&lt;&lt;std::uppercase&lt;&lt;hex&lt;&lt;todeci(bit_B)&lt;&lt;endl;
    }
    return 0;
}
</code></pre>

<p>here k value hacve changed automatically to hexa decimal which i cant figure out y?can anyone please help?
1
12
CAF7028FD
59B5AC1CE
CAF1B7B7F
for this input you will see k showing as B in output</p>