Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

laweacritica

program se_puso_critica;
var a:integer; {fila}
    b:integer; {columna}
    xl:array[1..101,1..101]of integer; {matriz}
    i,k,j,o,c,Q,W,R: integer; {auxiliares}
    jj,oo: real;
    x:array[1..10000]of integer; {vector}

begin
     writeln('engancha numero de fila entre 1 y 100');
     repeat
     read(a);                               {fila}
     if (a<1) or (a>100) then
     writeln('puta que eri weon, ingresa algo entre 1 y 100');
     until (a>=1) and (a<=100);
{---------------------------------------------}
     writeln('ahora suelta una columna');
     repeat
     read(b);                               {columna}
     if (b<1) or (b>100) then
     writeln('hermano enserio no ando na pa que me wei');
     until (b>=1) and (b<=100);
{---------------------------------------------}
     o:=a*b;
     writeln('pasa ',o,' numeros plox');
     for i:=1 to o do                  {vector para rellenar la matriz}
     readln(x[i]);
{---------------------------------------------}
     c:=1;
     for i:=1 to a do
     begin
          for k:=1 to b do
          begin                         {matriz rellenada}
               xl[i,k]:=x[c];
               c:=c+1;
          end;
     end;
{---------------------------------------------}
     for i:=1 to a do
     begin
          for k:=1 to b do
          begin
               write(xl[i,k],' ');      {matriz escrita}
          end;
          writeln;
     end;
{---------------------------------------------}
    j:=0;
    for i:=1 to o do
    begin
         j:=j+x[i];                     {promedio de valores de la matriz}
    end;
    jj:=j;
    oo:=o;
    jj:=jj / oo;
    writeln('le promedio es ',jj:0:2,'  c:');
{---------------------------------------------}
    Q:=0;
    for i:=1 to o do
    begin
         if x[i]>jj then
         begin
              Q:=Q+1;
         end;
    end;
    writeln('la cantidad de numeros mayores al promedio son ',Q);
{----------------------------------------------}
    W:=x[1];
    for i:=1 to o do
    begin
         if (x[i])<(W) then               {calcula el numero menor}
         W:=x[i];
    end;
    writeln('el menor numero de la matriz es ',W);
{-----------------------------------------------}
   R:=x[1];
   for i:=1 to o do
   begin                                   {calcula el numero mayor}
        if (x[i])>(R) then
        R:=x[i];
   end;
   writeln('el mayor numero de la matriz es ',R);

    readln;
    readln;
{------------------------------------------------}


end.
                

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.