obrigado....

Posted 07/09/2005, 19:01
#include <stdio.h> #include <stdlib.h> int main() { int x[6] = {1, 2, 3, 4, 5}; int y[6] = {5, 4, 3, 2, 1}; int i; for (i = 0; x[i]; i++) printf("x(%d) * y(%d) = %d\n", x[i], y[i], x[i] * y[i]); system("PAUSE"); return 0; }
Posted 04/10/2006, 18:13
Program multiplicacao_de_matrizes; Var matrizA: array [1..50,1..50] of integer; matrizB: array [1..50,1..50] of integer; matrizAB: array [1..50,1..50] of integer; lin1, col1, lin2, col2, i, j, k: integer; Begin writeln; writeln('-------- Multiplicação de 2 matrizes --------'); writeln; writeln('Para ser possivel a multiplicação de duas matrizes'); writeln(' o numero de colunas da primeira matriz'); writeln(' deve ser igual ao numero de linhas da segunda'); writeln; write('Digite o numero de linhas da primeira matriz: '); readln(lin1); write('Digite o numero de colunas da primeira matriz: '); readln(col1); writeln; write('Digite o numero de linhas da segunda matriz: '); readln(lin2); write('Digite o numero de colunas da segunda matriz: '); readln(col2); writeln; if ((col1)=(lin2)) then begin writeln('Escreva os elementos da matriz A: '); for i:=1 to lin1 do begin for j:=1 to col1 do begin write('a',i,j,': '); readln(matrizA[i,j]); end; end; writeln; writeln('Escreva os elementos da matriz B: '); for i:=1 to lin2 do begin for j:=1 to col2 do begin write('b',i,j,': '); readln(matrizB[i,j]); end; end; for i:=1 to lin1 do begin for j:=1 to col2 do begin matrizAB[i,j]:=0; for k:=1 to lin1 do matrizAB[i,j]:=matrizAB[i,j]+matrizA[i,k]*matrizB[k,j]; end; end; writeln; writeln('A matriz A*B :'); for i:=1 to lin1 do begin for j:=1 to col2 do write('ab',i,j,': ', matrizAB[i,j],' '); writeln; end; end else writeln('Nao eh possivel multiplicar essas matrizes'); End.
Posted 27/09/2017, 15:29
Posted 05/10/2017, 06:46
Posted 07/10/2017, 14:27
Posted 09/10/2017, 11:24
Posted 16/10/2017, 15:16
Posted 17/10/2017, 10:20
Posted 18/10/2017, 05:21
Posted 02/11/2017, 11:39
Posted 29/11/2017, 01:39
Posted 30/11/2017, 01:38
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)