Results 1 to 3 of 3

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Mortos's Avatar
    Join Date: Mar:2008
    Location: bg
    Posts: 116

    7. [10,10] B[12,12]. [-500 - 500]. :
    , - ; - - N;

    procedure moveMin(var a: matrix; size, M, N: integer; var max, min: integer);
    var
    i, j, minIndex, maxIndex, temp: integer;
    begin
    max := 0;
    min := 0;
    for i := 1 to size do
    begin
    minIndex := 1;
    for j := 2 to size do
    if a[i, j] < a[i, minIndex] then
    minIndex := j;
    if a[i, minIndex] < N then
    min := min + 1;
    if minIndex > 1 then
    begin
    temp := a[i, minIndex];
    for j := minIndex downto 2 do
    a[i, j] := a[i, j - 1];
    a[i, 1] := temp;
    end;

    maxIndex := 1;
    for j := 2 to size do
    if a[i, j] > a[i, maxIndex] then
    maxIndex := j;
    if a[i, maxIndex] > M then
    max := max + 1;
    if maxIndex < size then
    begin
    temp := a[i, maxIndex];
    for j := maxIndex to size - 1 do
    a[i, j] := a[i, j + 1];
    a[i, size] := temp;
    end;
    end;
    end;


    ?

  2. #2
    Registered User
    Join Date: Dec:2007
    Location: Sofia
    Posts: 366
    ? ? ? ?

  3. #3
    Registered User
    Join Date: Oct:2006
    Location: Plovdiv
    Posts: 305
    . - , - - 1 1 15
    prepBut nI vrbLike adjHungarian! qWhat's artThe adjBig nProblem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |