Uses GraphABC; var y, i, x, j, x1, y1: integer; begin moveto(0,320); lineto(2000,320); Line(120,100,80,140); Line(120,100,160,140); Line(120,160,80,200); Line(120,160,160,200); Line(120,220,80,260); Line(120,220,160,260); Line(120,100,120,320);
for i := 1 to 10 do begin x := random (1024); y := random (200);
for j:=1 to 3 do begin x1:=random(800); y1:=random(100); line(x1,y1,x1+40,y1+40); line(x1,y1+20,x1+40,y1+20); line(x1+40,y1,x1,y1+40); Line(x1+20,y1,x1+20,y1+40); end;
int t; int i = 0; while (n - i){ if (std::cin >> t){ a[i++] = t; } }
// Находим и выводим. n--; int max = -1; for (i = n-1; i >= 0; --i){ if (a[i] > *a && a[i] < a[n]){ max = i; break; } } std::cout << max+1 << std::endl; delete [] a;
var y, i, x, j, x1, y1: integer;
begin
moveto(0,320);
lineto(2000,320);
Line(120,100,80,140);
Line(120,100,160,140);
Line(120,160,80,200);
Line(120,160,160,200);
Line(120,220,80,260);
Line(120,220,160,260);
Line(120,100,120,320);
Rectangle(260,180,400,320);
Line(260,180,340,100);
line(340,100,400,180);
Rectangle(300,220,340,260);
Line(300,240,340,240);
line(320,220,320,260);
Rectangle(300,280,340,320);
for i := 1 to 10 do begin
x := random (1024);
y := random (200);
for j:=1 to 3 do
begin
x1:=random(800);
y1:=random(100);
line(x1,y1,x1+40,y1+40);
line(x1,y1+20,x1+40,y1+20);
line(x1+40,y1,x1,y1+40);
Line(x1+20,y1,x1+20,y1+40);
end;
Rectangle(460,200,500,320);
Line(460,220,500,220);
Line(460,240,500,240);
Line(460,260,500,260);
Line(460,280,500,280);
Line(460,300,500,300);
Line(500,200,560,200);
line(560,200,640,320);
line(500,320,640,320);
Circle(760,280,40);
Circle(760,220,20);
Circle(760,190,10);
Line(500,120,540,120);
line(600,20,600,60);
Line(600,180,600,220);
Line(660,120,700,120);
Circle(600,120,40);
FloodFill(140,440,clSkyBlue);
FloodFill(160,380,clSkyBlue);
FloodFill(160,350,clSkyBlue);
FloodFill(320,200,clGray);
FloodFill(310,230,clYellow);
FloodFill(330,230,clYellow);
FloodFill(310,250,clYellow);
FloodFill(330,250,clYellow);
FloodFill(302,20,clSilver);
FloodFill(600,140,clYellow);
FloodFill(320,300,clBrown);
FloodFill(320,160,clRed);
FloodFill(540,250,clTeal);
FloodFill(480,210,clMaroon);
FloodFill(480,230,clMaroon);
FloodFill(480,250,clMaroon);
FloodFill(480,270,clMaroon);
FloodFill(480,290,clMaroon);
FloodFill(480,310,clMaroon);
end;
end.
int main()
{
// Считываем.
int n;
std::cin >> n;
int * a = new int[n];
int t;
int i = 0;
while (n - i){
if (std::cin >> t){
a[i++] = t;
}
}
// Находим и выводим.
n--;
int max = -1;
for (i = n-1; i >= 0; --i){
if (a[i] > *a && a[i] < a[n]){
max = i;
break;
}
}
std::cout << max+1 << std::endl;
delete [] a;
std::cin.get();
std::cin.get();
return 0;
}