Pascal/Turbo Pascal - Ayuda con problema en pascal de Matriz por favor!

 
Vista:

Ayuda con problema en pascal de Matriz por favor!

Publicado por David (2 intervenciones) el 06/07/2013 18:41:29
Buenos Dias! podrian ayudarme con este problema de Matriz en pascal por favor?

Hacer un logaritmo que llene una matriz de 8*8, que almacene la suma de los renglones y la suma de las columnas en un vector. Imprimir el vector resultante.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ayuda con problema en pascal de Matriz por favor!

Publicado por ramon (2158 intervenciones) el 06/07/2013 19:37:04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{A ver si esto te encamina algo}
 
 program matriz;
  uses
    crt;
  const
     tmat = 8;
  type
    lamatriz = array[1..tmat,1..tmat] of integer;
  var
    lineas, columnas : integer;
    t, i, k : integer;
    rellen : integer;
    matri : lamatriz;
    vectorlinea : array[1..tmat] of integer;
    vectorcolumna : array[1..tmat] of integer;
    sum1, sum2 : integer;
 
  procedure rellenamatriz;
  begin
      randomize;
      for t := 1 to tmat do
        for i := 1 to tmat do
        matri[i,t] := random(67) + 1;
  end;
 
  procedure muestramatriz;
  begin
     writeln('**** La Matriz Es ****');
     writeln;
     for t := 1 to tmat do
     begin
        for i := 1 to tmat do
        begin
        write('  ',matri[i,t]);
        end;
        writeln;
      end;
  end;
 
 
   procedure sumas_colomnas_lineas;
   begin
       lineas := 0;
       columnas := 0;
       sum1 := 0;
       sum2 := 0;
       for t := 1 to tmat do
       begin
        for i := 1 to tmat do
        begin
          lineas := lineas + matri[i,t];
        end;
         vectorlinea[t] := lineas;
         sum1 := sum1 + lineas;
         lineas := 0;
      end;
      for i := 1 to tmat do
       begin
        for t := 1 to tmat do
        begin
          columnas := columnas + matri[i,t];
        end;
          vectorcolumna[i] := columnas;
          sum2 := sum2 + columnas;
          columnas := 0;
      end;
   end;
 
 begin
     clrscr;
     rellenamatriz;
     muestramatriz;
     sumas_colomnas_lineas;
     writeln;
     writeln(' ****  Valores  De Linea ****');
     writeln;
     for k := 1 to tmat do
     begin
        write('  ',vectorlinea[k]);
     end;
     writeln;
     writeln;
     writeln(' ****  Valores  De Columna ****');
     writeln;
     for k := 1 to tmat do
     begin
        write('  ',vectorcolumna[k]);
     end;
     writeln;
     writeln;
     writeln('  Las Lineas Suman   : ',sum1);
     writeln('  Las Columnas Suman : ',sum2);
     readkey;
 end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
2
Comentar

Ayuda con problema en pascal de Matriz por favor!

Publicado por David (2 intervenciones) el 06/07/2013 22:21:45
Excelente Amigo Ramon! de Verdad Muchisimas gracias!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar