#include <iostream>
usingnamespace std;
int digitcount(int n)
{
int count = 1;
int temp_n = n;
while (true)
{
temp_n /= 10;
if (temp_n != 0) ++count;
if (temp_n == 0) break;
}
return count;
}
int main()
{
int x = 123456;
int digits = digitcount(x);
int x1 = x / (10^(digits - 1)); // Should print the 1st digit
int x2 = x / (10^(digits - 2)); // Should print the 2nd digit
cout << x1 << "\t" << x2 << digits << endl;
return 0;
}