Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13

    Question

    . " "

    skype:deyan.minev
    :
    [10,10] [-100,100]. . :
    - , . .
    ,
    program dm;
    var
    a:array [1..10,1..10] of integer;
    i, j:integer;
    begin
    writeln <vyvedete stoinost za elementa:'>;
    randomize;
    for i:=1 to 10 do
    for j:=1 to do
    begin
    write<'a[',i,',',j,']='>
    a[i,j]:=random<101>-100;
    writeln<a[i,j]:3>;
    end;
    writeln;
    readln;
    for i:=1 to 10 do
    begin
    for j:=1 to 10 do
    write <a[i,j]:3.;
    writeln;
    end
    readln;
    for i:=1 to do
    begin
    max:=a[i,1];
    for j:=1 to 10 do
    if a[i,j].max then
    begin
    max:=a[i,j];
    imax:=i;
    jmax:=j;
    end;
    Last edited by DeYaNN; 14th December 2008 at 22:58.

  2. #2
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Code:
    program dm;
    var
      a:array [1..10,1..10] of integer;
      i, j:integer;
      max, imax, jmax: integer; /*  ,      . */
    
    begin
      writeln <vyvedete stoinost za elementa:'>;
      /*     () -    writeln('vyvedete...'),          ,      */
    
      randomize;
      for i:=1 to 10 do
        for j:=1 to do
        begin
          write<'a[',i,',',j,']='>;
          /*   - write('...',i,'...',j,'...') */
    
          a[i,j]:=random<101>-100;
          /*  (  , )      -100  0.  random(201)-100  -100  +100. */
    
          writeln<a[i,j]:3>;
          /*            .   ,      . ,     - .     ?         ,     readln  random+writeln? */
        end;
      writeln;
      readln; /*    input?    , .    writeln. :) */
      for i:=1 to 10 do
      begin
        for j:=1 to 10 do
        write <a[i,j]:3.;
        writeln;
      end
      readln;
    
      /* ,  ,  ,   . */
      for i:=1 to 10 do
      begin
        max:=a[i,1];
        for j:=1 to 10 do
          if a[i,j].max then
          begin
            max:=a[i,j];
            imax:=i;
            jmax:=j;
          end;
    , , ( ). , , , (.. [2,2] [9,9]). , :

    Code:
    sum := 0;
    for i:= 2 to 9 do
      for j := 2 to 9 do
        sum := sum + a[i,j];
    writeln;
    writeln(sum);
    , - - . , , , . , , .
    (10b) || !(10b)

  3. #3
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    !
    ; ;
    Code:
    program dm2;
    
    var a:array [1..10,1..10] of integer;
    i,j:integer;
    max,imax,jmax,sum:integer;
    begin
    write('a[',i,',',j,']=');
    a[i,j]:=random(201)-100;
    writeln(a[i,j]:3);
    writeln;
    for i:=1 to 10 do
    begin for j:=1 to 10 do
    write(a[i,j]:3);
    writeln;
    end;
    readln;
    sum:=0;
    for i:=2 to 9 do
    for j:=2 to 9 do
    sum:=sum+a[i,j];
    writeln;
    writeln(sum);
    end.
    Last edited by DeYaNN; 15th December 2008 at 17:22.

  4. #4
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    [CODE]program dm2;

    var a:array [1..10,1..10] of integer;
    i,j:integer;
    max,imax,jmax,sum:integer;
    ?

  5. #5
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by DeYaNN View Post
    [CODE]program dm2;

    var a:array [1..10,1..10] of integer;
    i,j:integer;
    max,imax,jmax,sum:integer;
    ?
    ...
    (10b) || !(10b)

  6. #6
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    , EXE PAS miroslav_genev@yahoo.com.

    EDIT:
    .
    1. writeln(a[i,j]:3) :5 ( 1 4 , , ).
    2. max, imax, jmax ( ) - .
    .
    Last edited by Tarvin; 15th December 2008 at 17:36.
    (10b) || !(10b)

  7. #7
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13


    ?
    Last edited by delian; 15th December 2008 at 18:06. Reason:

  8. #8
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    , ! , 2-3 " , "... a[i,j], i = 2..9, j = 2..9. ?
    , , - - - , " " ( " "). max min.
    (10b) || !(10b)

  9. #9
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    :
    - -84 - 54

    10 10 0
    Last edited by delian; 16th December 2008 at 08:14. Reason:

  10. #10
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by DeYaNN View Post
    10 10 0
    , . :-P
    Code:
    randomize;
    for i:=1 to 10 do
      for j:=1 to 10 do
        a[i,j]:=...
    . , , - - ( -)? :
    Code:
    for i:=1 to 10 do
      for j:=1 to 10 do
      begin
        if a[i,j] < min then min:=a[i,j];
        if a[i,j] > max then max:=a[i,j];
        sum:=sum+a[i,j];
      end;
    sum:=sum-(min+max);
    writeln(sum);
    , , , ( ), :
    Code:
    for i:=1 to 10 do
      for j:=1 to 10 do
      begin
        sum:=sum+a[i,j];
      end;
    sum:=sum-a[1,1]-a[10,10];
    writeln(sum);
    (10b) || !(10b)

  11. #11
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    , <> ?
    Last edited by DeYaNN; 15th December 2008 at 19:29.

  12. #12
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by DeYaNN View Post
    ... ?
    , var . "".
    (10b) || !(10b)

  13. #13
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    .
    Last edited by DeYaNN; 16th December 2008 at 01:07.

  14. #14
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    Code:
    program dm;
    var
    a:array [1..10,1..10] of integer;
    i,j:integer;
    max,min,sum:integer;
    begin
    write('a[',i,',',j,']=');
    for i:=1 to 10 do
    for j:=1 to 10 do
    a[i,j]:=random(200)-100 and 100;
    writeln(a[i,j]:5);
    readln;
    for i:=1 to 10 do
    begin for j:=1 to 10 do
    write (a[i,j]:5);
    writeln;
    end;
    readln;
    sum:=0;
    for i:=1 to 10 do
    for j:=1 to 10 do
    begin
    if a[i,j] < min then min:=a[i,j];
    if a[i,j] > max then max:=a[i,j];
    sum:=sum+a[i,j];
    end;
    sum:=sum-(min+max);
    writeln('sum=',sum:5);
    readln;
    end.
    , .

  15. #15
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Code:
    a[i,j]:=random(200)-100 and 100;
    :
    Code:
    random(101)-200;
    : "writeln(a[i,j]:5);".
    (10b) || !(10b)

  16. #16
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13


    sum=-14920

  17. #17
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739
    Tarvin,
    Code:
    random(101)-200;
    , -100 -200.
    Code:
    100 - random(201);
    DeYaNN, , . - - . - min max . a[i,j]? min - - , : -110, max, : +110.
    - , " , ", , .

    , , "randomize;". , .
    Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19

  18. #18
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by 4eRNoBiL View Post
    Tarvin, ...
    . , , . , -n , .
    @DeYaNN: , , . ?

    , , .
    (10b) || !(10b)

  19. #19
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    "randomize;" -100 +100 , :P
    Last edited by DeYaNN; 20th December 2008 at 21:08.

  20. #20
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739
    Quote Originally Posted by DeYaNN View Post
    "randomize;" -100 +100 , :P
    , , "random(101)" 0 100, 0 100, 101 101. , [0, 100]. " -200" , 200 ( ) 200 - [-200, -100].

    - ( , , ), .
    Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19

  21. #21
    Registered User DeYaNN's Avatar
    Join Date: Dec:2008
    Location: Stara Zagora
    Posts: 13
    -110 +110
    Last edited by DeYaNN; 20th December 2008 at 21:59.

  22. #22
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    Quote Originally Posted by DeYaNN View Post
    -110 +110
    Code:
    a[i,j] := random(201) - 100;
    , , - :
    Code:
    a[i,j] := -100 + random(201);
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  23. #23
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739
    Quote Originally Posted by DeYaNN View Post
    -110 +110
    . :
    Code:
    for i:=1 to 10 do
    for j:=1 to 10 do
    begin
    if a[i,j] < min then min:=a[i,j];
    if a[i,j] > max then max:=a[i,j];
    sum:=sum+a[i,j];
    end;
    , min max, . "if a[i,j] < min then min:=a[i,j];", min? . , 10000? min 10000 . .

    , "min=110;max=-110;" for. -100 +100, min - , = 100. , min, - . if- min . 110 - - - , 100. 101, - 1000... , . 110 .

    max.

    :
    Code:
    min = 110; max = -110;
    for i:=1 to 10 do
        for j:=1 to 10 do
            begin
              if a[i,j] < min then min:=a[i,j];
              if a[i,j] > max then max:=a[i,j];
              sum:=sum+a[i,j];
            end;
    .. , , F7, ...
    Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19

  24. #24
    Registered User
    Join Date: Oct:2003
    Posts: 1,860
    , , , ?

  25. #25
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by Jonata View Post
    , , , ?
    , . "feature":
    Code:
    {var}
       mincount, maxcount: Integer;
    
    {...}
    for i:=1 to 10 do
       for j:=1 to 10 do
       begin
          if a[i,j] < min then
          begin
             min:=a[i,j];
             mincount := 1;
          end else if a[i,j] = min then mincount := mincount + 1;
          if a[i,j] > max then
          begin
             max:=a[i,j];
             maxcount := 1;
          end else if a[i,j] > max then maxcount := maxcount + 1;
          sum:=sum+a[i,j];
       end;
    
    {...}
       sum := sum - ((min*mincount)+(max*maxcount));
    ...
    (10b) || !(10b)

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 |