Электронная почта на компьютере
Результат: ТМРРО
Const abc = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯА';
Var s : String;
Function Alg(ss : String) : String;
Var i : Integer;
Begin
If Odd(Length(ss)) then Insert(ss[(Length(ss) div 2)+1],ss,(Length(ss) div 2)+1) else ss:='С'+ss;
For i:=1 to Length(ss) do If Pos(ss[i],abc)>0 then ss[i]:=abc[Pos(ss[i],abc)+1];
Alg:=ss;
end;
Begin
{ Readln(s);
Writeln(Alg(s)); }
Writeln(Alg(Alg('КОМ')));
end.
Ответ:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var s:string;
n,i,k:byte;
begin
readln(s);
n:=length(s);
k:=0;
for i:=1 to n do
if upcase(s[i])='A' then
begin
inc(k);
if s[i]='a' then s[i]:='b'
else s[i]:='B';
end;
writeln(s);
write(k)
end.
Объяснение:
1)
Program n1; var cl,q: string; begin cl:='клоун'; writeln(cl); cl:=cl[1]+cl[4]+cl[2]+cl[3]+cl[5]; writeln(cl); end.
2)
Program n1; var i,k,k1: integer; st: string; x: char; begin readln(st); x:='м'; k := 0; k1:=0; for i := 1 to length(st) do if st[i] = x then k := k + 1; x:='н'; for i := 1 to length(st) do if st[i] = x then k1 := k1 + 1; if(k>k1) then writeln('м больше чем н'); if(k<k1) then writeln('н больше чем м'); end.
var x1, x2, x3, y1, y2, y3: integer;
AB, BC, AC, P: real;
function dlina (x1, y1, x2, y2: integer):real;
begin
dlina :=sqrt(sqr(x2-x1)+sqr(y2-y1));
end;
begin
writeln ('Введите координаты точки A');
read (x1,y1);
writeln ('Введите координаты точки B');
read (x2,y2);
writeln ('Введите координаты точки C');
read (x3,y3);
AB:= dlina (x1, y1, x2, y2);
BC:= dlina (x2, y2, x3, y3);
AC:= dlina (x1, y1, x3, y3);
P:=AB+BC+AC;
writeln ('Периметр треугольника равен',' ', P);
end.