Var a:string[20]; st,b,i:integer; begin writeln('Введите двоичное число:'); readln(a); st:=1; b:=0; for i:=length(a) downto 1 do begin if a[i]='1' then b:=b+st; st:=2*st; end; writeln(b); end.
//PascalABC.NET версия 3.2, сборка 1389 //Если программа не запускается, то обновите версию uses System.Linq; begin begin writeln('I'); var n := ReadInteger('n='); Writeln((1 + 1 + Power(2, n - 1)) * n / 2); end;
begin writeln; writeln('II'); var n := ReadInteger('n='); Writeln(n mod 11 = 0 ? 'YES' : 'NO');
end;
begin writeln; writeln('III'); var a := ReadArrInteger('Документы', ReadInteger('n=')).ToList; writeln;
while a.Any() do begin write(a[0], ' '); a.RemoveAt(0); if not a.Any then break;
write(a.Last, ' '); a.RemoveAt(a.Count - 1); if not a.Any then break;
var n := 0; if a.Count > 1 then n := a.Count div 2 - 1; write(a[n], ' '); a.RemoveAt(n); end; end; end.
def main(): for event in longpoll.listen(): if event.type == VkBotEventType.MESSAGE_NEW and (action := event.obj['message'].get('action')): if action['type'] == 'chat_kick_user': vk.messages.removeChatUser( chat_id=event.chat_id, user_id=action['member_id'], )
if __name__ == '__main__': main() Не забудьте, что боту необходимо выдать права администратора беседы
begin
writeln('Введите двоичное число:');
readln(a);
st:=1; b:=0;
for i:=length(a) downto 1 do
begin
if a[i]='1' then b:=b+st;
st:=2*st;
end;
writeln(b);
end.