Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <inttypes.h>
  3.  
  4. int main()
  5. {
  6.     int32_t a, b, n;
  7.  
  8.     if(scanf("%d%d%d", &a, &b, &n) != 3)
  9.     {
  10.         fprintf(stderr, "Sorry, can't read");
  11.         return 1;
  12.     }
  13.  
  14.     for (int32_t i = a - 1; i < b; ++i)
  15.     {
  16.         if (i == a - 1)
  17.         {
  18.             for (int32_t j = 0; j < n; ++j)
  19.             {
  20.                 printf("%c", ' ');
  21.             }
  22.         }
  23.         else
  24.         {
  25.             printf(" %*d", n, i);
  26.         }
  27.     }
  28.     printf("\n");
  29.  
  30.     for (int32_t i = a; i < b; ++i)
  31.     {
  32.         printf("%*d", n, i);
  33.         for (int32_t j = a; j < b; ++j)
  34.         {
  35.             int64_t ans = i * j;
  36.             printf(" %*ld", n, ans);
  37.         }
  38.         printf("\n");
  39.     }
  40.  
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement