var
B: array [1..10] of string :=('а','р','ц','ь','т','в','ц','п','б','с');
total: integer;
begin
for var i:= 1 to 10 do
if B[i]='п' then total:=total+i;
if B[i]='р' then total:=total+i;
if B[i]='с' then total:=total+i;
if B[i]='т' then total:=total+i;
end;
writeln(total);
end.
Объяснение:
var
B: array [1..10] of string :=('а','р','ц','ь','т','в','ц','п','б','с');
total: integer;
begin
for var i:= 1 to 10 do
begin
if B[i]='п' then total:=total+i;
if B[i]='р' then total:=total+i;
if B[i]='с' then total:=total+i;
if B[i]='т' then total:=total+i;
end;
writeln(total);
end.
Объяснение: