срочно, помогите, хотябы...

Тема в разделе "Информатика", создана пользователем Manya_, 24 янв 2010.

  1. Manya_

    Manya_ New Member

    срочно, помогите, хотябы пару пунктов, желательно все((((((! Даны описания: type Oras = (Chisinau, Orhei, Balti, Tigina, Tiraspol); Zi = (L, Ma, Mi, J, V, S, D);
     
  2. PIKINEZ

    PIKINEZ New Member

    type Oras = (Chisinau, Orhei, Balti, Tigina, Tiraspol);
    Zi = (L, Ma, Mi, J, V, S, D);
    Consum = array [Oras, Zi] of real;
    var C : Consum;
    r : Oras;
    z : Zi;
    i,k : integer;
    sum,min_r,max_r,min_z,max_z:real;
    n_max_r,n_min_r,n_max_z,n_min_z:integer;
    begin
    r:=Chisinau;
    randomize;
    for i:=1 to 5 do
    begin
    z:=L;
    for k:=1 to 7 do
    begin
    c[r,z]:=random*100;
    z:=succ(z);
    end;
    r:=succ(r);
    end;
    r:=Chisinau;
    for i:=1 to 5 do
    begin
    z:=L;
    case ord(r) of
    0:writeln('Chisinau');
    1:writeln('Orhei');
    2:writeln('Balti');
    3:writeln('Tigina');
    4:writeln('Tiraspol');
    end;
    for k:=1 to 7 do
    begin
    write(c[r,z]:6:2);
    z:=succ(z);
    end;
    r:=succ(r);
    writeln;
    end;
    writeln('Vsego za nedelu');
    r:=Chisinau;
    min_r:=99999;
    max_r:=0;
    n_min_r:=-1;
    n_max_r:=-1;
    for i:=1 to 5 do
    begin
    z:=L;
    case ord(r) of
    0:write('Chisinau sum=');
    1:write('Orhei sum=');
    2:write('Balti sum=');
    3:write('Tigina sum=');
    4:write('Tiraspol sum=');
    end;
    sum:=0;
    for k:=1 to 7 do
    begin
    sum:=sum+c[r,z];
    z:=succ(z);
    end;
    if sum>max_r then
    begin
    max_r:=sum;
    n_max_r:=ord(r);
    end;
    if sum<min_r then
    begin
    min_r:=sum;
    n_min_r:=ord(r);
    end;
    r:=succ(r);
    writeln(sum:8:2);
    end;
    writeln('Po dnyam nedeli');
    z:=L;
    min_z:=99999;
    max_z:=0;
    n_min_z:=-1;
    n_max_z:=-1;
    for k:=1 to 7 do
    begin
    r:=Chisinau;
    case ord(z) of
    0:write('L sum=');
    1:write('Ma sum=');
    2:write('Mi sum=');
    3:write('J sum=');
    4:write('V sum=');
    5:write('S sum=');
    6:write('D sum=');
    end;
    sum:=0;
    for i:=1 to 5 do
    begin
    sum:=sum+c[r,z];
    r:=succ(r);
    end;
    if sum>max_z then
    begin
    max_z:=sum;
    n_max_z:=ord(z);
    end;
    if sum<min_z then
    begin
    min_z:=sum;
    n_min_z:=ord(z);
    end;
    z:=succ(z);
    writeln(sum:8:2);
    end;
    writeln('Gorod c maximalnim potrebleniem');
    r:=Chisinau;
    for i:=1 to 5 do
    begin
    if ord(r)=n_max_r then
    case ord(r) of
    0:writeln('Chisinau');
    1:writeln('Orhei');
    2:writeln('Balti');
    3:writeln('Tigina');
    4:writeln('Tiraspol');
    end;
    r:=succ(r);
    end;
    writeln('Gorod c minimalnim potrebleniem');
    r:=Chisinau;
    for i:=1 to 5 do
    begin
    if ord(r)=n_min_r then
    case ord(r) of
    0:writeln('Chisinau');
    1:writeln('Orhei');
    2:writeln('Balti');
    3:writeln('Tigina');
    4:writeln('Tiraspol');
    end;
    r:=succ(r);
    end;
    writeln('Den c maximalnim potrebleniem');
    z:=L;
    for k:=1 to 7 do
    begin
    if ord(z)=n_max_z then
    case ord(z) of
    0:writeln('L');
    1:writeln('Ma');
    2:writeln('Mi');
    3:writeln('J');
    4:writeln('V');
    5:writeln('S');
    6:writeln('D');
    end;
    z:=succ(z);
    end;
    writeln('Den c minimalnim potrebleniem');
    z:=L;
    for k:=1 to 7 do
    begin
    if ord(z)=n_min_z then
    case ord(z) of
    0:writeln('L');
    1:writeln('Ma');
    2:writeln('Mi');
    3:writeln('J');
    4:writeln('V');
    5:writeln('S');
    6:writeln('D');
    end;
    z:=succ(z);
    end;
    readln;
    end.
     

Поделиться этой страницей

Наша группа