Advertisement
tdttvd

bang_cuu_chuong

Dec 22nd, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define width 10
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     printf("N = ");
  9.     scanf("%d", &n);
  10.  
  11.     for (int i = 1; i <= 10; ++i)
  12.     {
  13.         for (int j = 1; j <= n; ++j)
  14.         {
  15.             if (i != 10) printf("%d x %d = %-*d", i, j, width, i * j);
  16.             else printf("%d x %d = %-*d", i, j, width - 1, i * j);
  17.         }
  18.         printf("\n");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement