Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int temp = n;
int c = 0;
while (temp != 0)
{
c++;
temp = temp / 10;
}
int jum;
if (c % 2 == 0)
jum = (c / 2);
else
jum = (c / 2) + 1;
int j = 1;
for (int i = 0; i < jum; i++)
j = j * 10;
int p1 = n / j;
int p2 = n % j;
cout << endl
<< p1 << " "
<< p2 << endl;
}
Explicație: