LOVEGUN

Exercice 10 (Série ISI)

Oct 10th, 2021 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int n,i,j,x;
  7.     int m[10][10];
  8.     do{
  9.         printf ("Veuillez saisir un entier N\n");
  10.         scanf ("%d",&n);
  11.     }while (n<=1 || n>=10);
  12.     x=0;
  13.     for (i=1;i<=n;i++)
  14.     {
  15.         for (j=1;j<=i;j++)
  16.         {
  17.             x++;
  18.             m[i][j]=x;
  19.             printf ("%d",m[i][j]);
  20.             if (x==9)
  21.             {
  22.                 x=0;
  23.             }
  24.         }
  25.         printf ("\n");
  26.     }
  27. }
  28.  
Add Comment
Please, Sign In to add comment