Var dc:set of char; s1,s2:string; i:integer; begin dc:=['A'..'D','a'..'d']; s1:='То avoid the impression of the tail wagging the dog, '+ 'the president cannot be seen bending to the wishes of a minority.'; s2:=''; for i:=1 to length(s1) do if not(s1[i] in dc) then s2:=s2+s1[i]; Writeln('Исходная строка: ',s1); s1:=s2; Writeln('Результирующая строка: ',s1) end.
Тестовое решение: Исходная строка: То avoid the impression of the tail wagging the dog, the president cannot be seen bending to the wishes of a minority. Результирующая строка: То voi the impression of the til wgging the og, the presient nnot e seen ening to the wishes of minority.
dc:set of char;
s1,s2:string;
i:integer;
begin
dc:=['A'..'D','a'..'d'];
s1:='То avoid the impression of the tail wagging the dog, '+
'the president cannot be seen bending to the wishes of a minority.';
s2:='';
for i:=1 to length(s1) do
if not(s1[i] in dc) then s2:=s2+s1[i];
Writeln('Исходная строка: ',s1);
s1:=s2;
Writeln('Результирующая строка: ',s1)
end.
Тестовое решение:
Исходная строка: То avoid the impression of the tail wagging the dog, the president cannot be seen bending to the wishes of a minority.
Результирующая строка: То voi the impression of the til wgging the og, the presient nnot e seen ening to the wishes of minority.
1011101100010101010111100101010 = 2^30*1 + 2^29*0 + 2^28*1 + 2^27*1 + 2^26*1 + 2^25*0 + 2^24*1 + 2^23*1 + 2^22*0 + 2^21*0 + 2^20*0 + 2^19*1 + 2^18*0 + 2^17*1 + 2^16*0 + 2^15*1 + 2^14*0 + 2^13*1 + 2^12*0 + 2^11*1 + 2^10*1 + 2^9*1 + 2^8*1 + 2^7*0 + 2^6*0 + 2^5*1 + 2^4*0 + 2^3*1 + 2^2*0 + 2^1*1 + 2^0*0 =
1073741824 + 0 + 268435456 + 134217728 + 67108864 + 0 + 16777216 + 8388608 + 0 + 0 + 0 + 524288 + 0 + 131072 + 0 + 32768 + 0 + 8192 + 0 + 2048 + 1024 + 512 + 256 + 0 + 0 + 32 + 0 + 8 + 0 + 2 + 0 = 1569369898