Var s: string; a, b: integer; begin readln(s); if s[1] = 'x' then begin a := StrToInt(s[3]); b := StrToInt(s[5]); if s[2] = '-' then a := -a; writeln(b - a); end else if s[3] = 'x' then begin a := StrToInt(s[1]); b := StrToInt(s[5]); if s[2] = '-' then begin a := -a; b := -b; end; writeln(b - a); end else if s[5] = 'x' then begin a := StrToInt(s[1]); b := StrToInt(s[3]); if s[2] = '-' then b := -b; writeln(a + b); end end.
учтите что никакой защиты от дурака или неверного ввода
i, n, s: integer;
begin
readln(n);
i := 0;
s := 0;
while i < 7 do
begin
if (n mod 2 = 1) then begin
s := s + n;
i := i + 1;
end;
n := n + 1;
end;
writeln(s);
end.
var
i, n, s: integer;
begin
readln(n);
i := 0;
s := 0;
repeat
if (n mod 2 = 1) then begin
s := s + n;
i := i + 1;
end;
n := n + 1;
until i >= 7;
writeln(s);
end.
var
i, n, s: integer;
begin
readln(n);
n := n + (n + 1) mod 2;
s := 0;
for i := 1 to 7 do
begin
s := s + n;
writeln(n);
n := n + 2;
end;
writeln(s);
end.
s: string;
a, b: integer;
begin
readln(s);
if s[1] = 'x' then begin
a := StrToInt(s[3]);
b := StrToInt(s[5]);
if s[2] = '-' then a := -a;
writeln(b - a);
end
else if s[3] = 'x' then begin
a := StrToInt(s[1]);
b := StrToInt(s[5]);
if s[2] = '-' then begin
a := -a;
b := -b;
end;
writeln(b - a);
end
else if s[5] = 'x' then begin
a := StrToInt(s[1]);
b := StrToInt(s[3]);
if s[2] = '-' then
b := -b;
writeln(a + b);
end
end.
учтите что никакой защиты от дурака или неверного ввода