PascalABC.NET
#1
function Y(x:integer) := 2*((x+2)**2)+5.5*(x+2) - 3;
begin
var Xes := Range(3, 25);
Xes.Tabulate(p -> Y(p)).Println;
end.
#2
const PASS = '123ab';
begin
var rpass := Readstring('Pass: ');
while rpass <> PASS do begin
rpass := Readstring('Wrong pass. Try again: ');
end;
print('Correct password. Welcome');
end.
#3
begin
//Сначала читаем цифру, которую надо удалить, а уже потом число.
var X := ReadChar();
var number := ReadInteger().ToString.ToCharArray.ToList;
while number.Contains(X) do number.Remove(X);
number.JoinIntoString.Println;
end.
#4
begin
var X := ReadInteger();
Print((x div 100)+(x mod 100));
end.
Объяснение:
язык программирования любой?
пишу на Python:
s = str(input())
s = sorted(s[:len(s)-1].split(', '))
for word in s:
print(word, ' ', end='')
Pascal:
var s, copy_s, word_s:string;
i, n, count:integer;
a:array of string ;
begin
count:=0;
write('Введите перечисление слов через запятую без пробелов, в конце поставьте точку: ');
readln(s);
copy_s:= s;
while pos(',', copy_s) > 0 do begin
n:= pos(',', copy_s);
delete(copy_s, n, 1);
count:=count+1;
end;
count:= count + 1;
SetLength(a, count);
for i:=1 to count-1 do begin
n:= pos(',', s);
word_s:= copy(s, 1, n-1);
delete(s, 1, n);
a[i]:=word_s;
end;
word_s:= copy(s, 1, length(s)-1);
a[count]:= word_s;
for i:=1 to count-1 do
if a[i] > a[i+1] then begin
word_s:=a[i];
a[i]:=a[i+1];
a[i+1]:=word_s;
end;
for i:=1 to count do
writeln(a[i]);
end.
каждый пиксель занимает 32 байта (1 бит на каждый цвет).
теперь умножаем число пикселей на объем памяти, занятый каждым пикселем - 32х784=25088 байт=200'704 бит