Var max1,max2,min1,min2,i:integer; ar:array[1..n] of integer; begin max1:=integer.MinValue; max2:=integer.MinValue; min1:=integer.MaxValue; min2:=integer.MaxValue; for i:=1 to n do begin readln(ar[i]); if (ar[i]<max1) and (ar[i]>max2) then max2:=ar[i] else if ar[i]>max1 then begin max2:=max1; max1:=ar[i]; end; if (ar[i]>min1) and (ar[i]<min2) then min2:=ar[i] else if ar[i]<min1 then begin max2:=max1; min1:=ar[i]; end; end; writeln('Сумма максимумов:',max1+max2); writeln('Cумма минимумов:',min1+min2); end.
Пример ввода: 1 2 3 4 5 Пример вывода: Сумма максимумов:9 Cумма минимумов:3
procedure quicksort(var a:array of integer; Lo,Hi: integer);
procedure sort(l,r: integer); var i,j,x:integer; begin i:=l; j:=r; x:=a[random(r-l+1)+l]; repeat while a[i]>x do i:=i+1; while x>a[j] do j:=j-1; if i<=j then begin if a[i]<a[j] then swap(a[i],a[j]); i:=i+1; j:=j-1; end; until i>=j; if l<j then sort(l,j); if i<r then sort(i,r); end;
begin; randomize; sort(Lo,Hi) end;
begin readln(n); setlength(ar,n); n:=n-1; writeln('Array:'); for i:=0 to n do begin ar[i]:=random(10); write(ar[i]:4); end; quicksort(ar,0,n); writeln; writeln('Final array:'); for i:=0 to n do write(ar[i]:4); end.
Пример ввода: 5 Пример вывода: Array: 8 7 5 9 4 Final array: 9 8 7 5 4
можете пожайлуста более в понятной форме пояснить свой вопрос
если я вас правильно понела то
нудно нажать на F 12 и ввести данный " правильный код"
<html>
<head>
<title>Slovo - Одесса</title>
<style>
html
{
height:100%;
}
body
{
margin:0;
height:100%;
background:url(Image/pr.png);
background-size:100%100%;
}
.wrapper
{
position: relative;
display: block;
min-width: 960px;
min-height: 700px;
}
.logo
{
position:absolute;
top:5px;
right:990px;
}
.logo1
{
position:absolute;
top:645px;
right:2000px;
}
.logo2
{
position:absolute;
top:655px;
right:1050px;
}
.logo3
{
position:absolute;
top:634px;
right:200px;
}
.logo4
{
position:absolute;
top:1000px;
right:2100px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="logo">
<a href="prdsl.html">
<img src="Image/pr1.png">
</a>
</div>
<div class="logo1">
<a href="News.html">
<img src="Image/pr2.png">
</a>
</div>
<div class="logo2">
<a href="Video.html">
<img src="Image/pr3.png">
</a>
</div>
<div class="logo3">
<a href="cntk.html">
<img src="Image/pr4.png">
</a>
</div>
<div class="logo4">
<font size="10" color="white" face="Politica">О ПРОЕКТЕ</font>
</div>
</div>
</body>
</html>