Advertisement
Guest User

Remplir matrice (Planète Casio)

a guest
Aug 18th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. typedef struct
  2. {
  3.     int t[5][5];
  4. } Tableau
  5.  
  6. void remplir_matrice(Tableau *matrice)
  7. {
  8.     int x, y;
  9.        
  10.         for(y = 0; y < dim_y; y++)
  11.         {
  12.                 for(x = 0; x < dim_x; x++)
  13.                 {
  14.                         if(x == y)
  15.                                 matrice->t[y][x] = 1;
  16.                         else
  17.                                 matrice->t[y][x] = 0;
  18.                 }
  19.         }
  20. }
  21.  
  22. int main()
  23. {
  24.     Tableau ma_matrice;
  25.  
  26.     remplir_matrice(&ma_matrice);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement