Mathc matrices/c102c

Un livre de Wikilivres.


Application


Installer et compiler ces fichiers dans votre répertoire de travail.


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
void fun(int r,int c)
{
double **A     = r_mR(i_mR(r,c),99.);

  clrscrn();
  printf(" A :\n");
  pall_mR(A,S5,P0,C10); 
  
  printf(" A :\n");
  pall_mR(swapC_withR0_mR(A,C1,C2),S5,P0,C10);       

  f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

int i;

do
{
  i = rp_I(R3)+R1;
  
  fun(i,i+C1);

} while(stop_w());

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */




Exemple de sortie écran :
 ------------------------------------ 
 A :
+4          +1    +2    +3    +4 

+5         -66   +83   +99   +48 
+0         -93   +77    -5   -67 
+0         -27   +44   -33   +24 

 A :
+4          +2    +1    +3    +4 

+5         +83   -66   +99   +48 
+0         +77   -93    -5   -67 
+0         +44   -27   -33   +24 


 Press return to continue
 Press X      to stop