Mathc matrices/c24y
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c01a.c |
---|
/* ------------------------------------ */
/* Save as : c01a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void AplsB(int r,int c)
{
double **A[3];
A[0] = i_mR(r,c);
A[1] = i_mR(r,c);
A[2] = i_mR(r,c);
r_mR(A[0],9);
r_mR(A[1],9);
clrscrn();
printf(" A0 : ");
p_mR(A[0],5,0,6);
printf(" A1 : ");
p_mR(A[1],5,0,6);
add_mR(A[0],A[1],A[2]);
printf(" A0plsA1 : ");
p_mR(A[2],5,0,6);
f_mR(A[0]);
f_mR(A[1]);
f_mR(A[2]);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do{
AplsB(rp_I(R5),rp_I(C5));
}while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Créer un tableau de matrices :
double **A[3];
A[0] = i_mR(r,c);
A[1] = i_mR(r,c);
A[2] = i_mR(r,c);
Exemple de sortie écran :
A0 :
+5 +3 +9 +1
+1 -9 +6 -7
+5 +3 -5 +1
+7 +6 -9 -8
-7 +5 -2 +5
A1 :
+3 -6 -1 -9
+7 +6 -7 +2
-2 +1 +4 +2
-4 -3 -6 -2
+5 -2 +7 -5
A0plsA1 :
+8 -3 +8 -8
+8 -3 -1 -5
+3 +4 -1 +3
+3 +3 -15 -10
-2 +3 +5 +0
Press return to continue
Press X to stop