include iostream using namespace std int main int setlocale LC_ALL rus

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
using namespace std;
int main()
{
int a;
setlocale(LC_ALL, "rus");
cout << "Введите 5-значное число:";
int n1, n2, n3, n4, n5;
cin >> a;
n1 = a / 10000;
n2 = (a - n1 * 10000) / 1000;
n3 = (a - n1 * 10000 - n2 * 1000) / 100;
n4 = (a - n1 * 10000 - n2 * 1000 - n3 * 100) / 10;
n5 = (a - n1 * 10000 - n2 * 1000 - n3 * 100 - n4 * 10);
cout << n1 << " " << n2 << " " << n3 << " " << n4 << " " << n5 << endl;
system("pause");
return 0;
}