Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 5
- //https://otvet.mail.ru/question/217487097
- int main()
- {
- 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};
- //{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};
- //{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};
- sum = 0;
- for(i=0;i<SIZE/2+1;i++)//
- {
- for(j=i;j<SIZE-i;j++)
- {
- printf("%d\t",arr[i][j]);
- }
- printf("\n");
- }
- for(i=SIZE/2+1;i<SIZE;i++)
- {
- printf("\niiii-%d\n",i);
- for(j=SIZE/2+2-i;j<SIZE/2+i-1;j++)
- {
- printf("%d\t",arr[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment