Lisaveta777

Треугольники,ромбы

Dec 1st, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define SIZE 5
  4. //https://otvet.mail.ru/question/217487097
  5.  
  6. int main()
  7. {
  8.     int sum,i, j,arr[SIZE][SIZE]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
  9.     //{11,12,13,14,15,21,22,23,24,25,31,32,33,34,35,41,42,43,44,45,51,52,53,54,55};
  10.     //{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
  11.     sum = 0;
  12.  
  13.    for(i=0;i<SIZE/2+1;i++)//
  14.    {
  15.        for(j=i;j<SIZE-i;j++)
  16.        {
  17.            printf("%d\t",arr[i][j]);
  18.        }
  19.         printf("\n");
  20.  
  21.    }
  22.    for(i=SIZE/2+1;i<SIZE;i++)
  23.    {
  24.        printf("\niiii-%d\n",i);
  25.        for(j=SIZE/2+2-i;j<SIZE/2+i-1;j++)
  26.        {
  27.            printf("%d\t",arr[i][j]);
  28.  
  29.        }
  30.         printf("\n");
  31.    }
  32.  
  33.  
  34.  
  35.     return 0;
  36. }
Add Comment
Please, Sign In to add comment