var a,b,c,max,min,s: integer;
begin
readln(a,b,c);
if a>b then max:=a else max:=b;
if c>max then max:=c;
if a<b then min:=a else min:=b;
if c<min then min:=c;
s:=(a+b+c)-(max+min);
writeln(s);
end.
Пример:
5 2 9
5
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var a,b,c,max,min,s: integer;
begin
readln(a,b,c);
if a>b then max:=a else max:=b;
if c>max then max:=c;
if a<b then min:=a else min:=b;
if c<min then min:=c;
s:=(a+b+c)-(max+min);
writeln(s);
end.
Пример:
5 2 9
5