Потому что ей это не нужно!
Она и так хорошо справляется ;)
#include <iostream>
using namespace std;
union type {
short si;
int i;
float f;
char ch;
bool b;
};
int main()
{
type example;
cout << "Union:\n";
example.si = 123;
cout << " Short int " << example.si << endl;
example.i = 2000145;
cout << " Int " << example.i << endl;
example.f = 3.14;
cout << " Float " << example.f << endl;
example.ch = 'a';
cout << " Char " << example.ch << endl;
example.b = false;
cout << " Bool " << example.b << endl;
return 0;
}
Var
a:integer;
begin
readln(a);
If (a<10000) and (a>=0) then
If (a>999) then
If ((a div 1000)=(a mod 10)) and ((a div 10 mod 10)=(a div 100 mod 10)) then
writeln('1')
else
writeln('2')
else
If (a>99) and (a<1000) then
If ((a div 100)=(a mod 10)) then
writeln('1')
else
writeln('2')
else
If (a>9) and (a<100) then
If ((a div 10)=(a mod 10)) then
writeln('1')
else
writeln('2')
else
writeln('1')
else
writeln('Неправльное число');
end.
Большое немного решение, может можно и поменьше, но так точно правильно