Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- int low = 4;
- int high = low;
- int p = 1;
- for (int i = 1; i <= 4; i++)
- {
- for (int j = 1; j <= 7; j++)
- {
- if (j >= low && j <= high)
- {
- if (i % 2 == 0 && j % 2 == 0)
- {
- printf(" ");
- }
- else if (i % 2 == 1 && j % 2 == 1)
- {
- printf(" ");
- }
- else
- {
- printf("%d", p);
- p++;
- }
- }
- else
- {
- printf(" ");
- }
- }
- printf("\n");
- low -= 2;
- high += 2;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement