Var A,B0,B1,B2,B3,B4,B5,B6,B7,B8,B9:integer; Begin WriteLn('Введите число'); ReadLn(A); While A>0 do Begin Case A mod 10 of 0:B0:=B0+1; 1:B1:=B1+1; 2:B2:=B2+1; 3:B3:=B3+1; 4:B4:=B4+1; 5:B5:=B5+1; 6:B6:=B6+1; 7:B7:=B7+1; 8:B8:=B8+1; 9:B9:=B9+1; End; A:= A div 10; End; if (B0 = 3)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)then WriteLn('Верно') else if (B1 = 3)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)then WriteLn('Верно') else if (B2 = 3)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)then WriteLn('Верно') else if (B3 = 3)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)then WriteLn('Верно') else if (B4 = 3)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)then WriteLn('Верно') else if (B5 = 3)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)then WriteLn('Верно') else if (B6 = 3)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)then WriteLn('Верно') else if (B7 = 3)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)then WriteLn('Верно') else if (B8 = 3)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)then WriteLn('Верно') else if (B9 = 3)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)then WriteLn('Верно') else WriteLn('Не верно') End.
Программы из 5 команд и результаты их выполнения: 11111: 7^5 * 2^5 = 16807 * 32 = 537824 11112: 7^5 / 7 * 2^4 = 2401 * 2^4 = 38416 11122: 7^5 / 7^2 * 2^3 = 343 * 8 = 2744 11222: 7^5 / 7^3 * 2^2 = 49 * 4 = 196 12222: 7^5 / 7^4 * 2 = 7 * 2 = 14 22222: 7^5 / 7^5 = 1 (Сами числа вычислять не обязательно) Все другие программы будут давать в результате одно из перечисленных выше значений. Например, результат программы 12121 = результату программы 11122: 7^5 * 2 / 7 * 2 / 7 * 2 = 7^5 / 7^2 * 2^3 ответ: количество различных чисел = 6
A,B0,B1,B2,B3,B4,B5,B6,B7,B8,B9:integer;
Begin
WriteLn('Введите число');
ReadLn(A);
While A>0 do
Begin
Case A mod 10 of
0:B0:=B0+1;
1:B1:=B1+1;
2:B2:=B2+1;
3:B3:=B3+1;
4:B4:=B4+1;
5:B5:=B5+1;
6:B6:=B6+1;
7:B7:=B7+1;
8:B8:=B8+1;
9:B9:=B9+1;
End;
A:= A div 10;
End;
if (B0 = 3)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)then WriteLn('Верно')
else if (B1 = 3)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)then WriteLn('Верно')
else if (B2 = 3)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)then WriteLn('Верно')
else if (B3 = 3)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)then WriteLn('Верно')
else if (B4 = 3)and(B5<2)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)then WriteLn('Верно')
else if (B5 = 3)and(B6<2)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)then WriteLn('Верно')
else if (B6 = 3)and(B7<2)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)then WriteLn('Верно')
else if (B7 = 3)and(B8<2)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)then WriteLn('Верно')
else if (B8 = 3)and(B9<2)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)then WriteLn('Верно')
else if (B9 = 3)and(B0<2)and(B1<2)and(B2<2)and(B3<2)and(B4<2)and(B5<2)and(B6<2)and(B7<2)and(B8<2)then WriteLn('Верно')
else WriteLn('Не верно')
End.
11111: 7^5 * 2^5 = 16807 * 32 = 537824
11112: 7^5 / 7 * 2^4 = 2401 * 2^4 = 38416
11122: 7^5 / 7^2 * 2^3 = 343 * 8 = 2744
11222: 7^5 / 7^3 * 2^2 = 49 * 4 = 196
12222: 7^5 / 7^4 * 2 = 7 * 2 = 14
22222: 7^5 / 7^5 = 1
(Сами числа вычислять не обязательно)
Все другие программы будут давать в результате одно из перечисленных выше значений. Например, результат программы 12121 = результату программы 11122:
7^5 * 2 / 7 * 2 / 7 * 2 = 7^5 / 7^2 * 2^3
ответ: количество различных чисел = 6