Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define N 5
- //https://otvet.mail.ru/question/217761600
- int main()
- {
- int i,j;
- for(i=0;i<N;i++)//one
- {
- for(j=0;j<N;j++)
- {
- if(i+2>N-j)
- printf("%d",N-j);
- else
- printf(" ");
- }
- printf("\n");
- }
- for(i=0;i<N;i++)//two
- {
- for(j=0;j<N;j++)
- {
- if(j>i)
- printf("%d",N-j);
- else
- printf(" ");
- }
- printf("\n");
- }
- ///////////////
- for(i=0;i<N;i++)//three
- {
- for(j=0;j<2*N;j++)
- {
- if(i>j||j>=N)
- printf(" ");
- else
- printf("%d",j+1);
- }
- printf("\n");
- }
- for(i=0;i<N-1;i++)//four
- {
- for(j=0;j<2*N;j++)
- {
- if(j>i+N||j<N-1)
- printf(" ");
- else
- printf("%d",2*N-j-1);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement