Напишите программу, которая определяет, верно ли, что введённое число содержит ровно три одинаковые цифры, а все остальные встречаются только по одному разу (например, как в числе 77237) pascalabc ! решать при while!

ketium2oo5 ketium2oo5    3   25.08.2019 01:10    4

Ответы
popova2015 popova2015  05.10.2020 17:44
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.
ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика