You are viewing a single comment's thread. Return to all comments →
I modified that to this:
#include <stdio.h> #define min(a, b) ((a) < (b) ? (a) : (b)) int main() { int n; scanf("%d", &n); int len = n * 2 - 1; for(int row = 0; row < len; row++) { for(int col = 0; col < len; col++) { int m = min(row, col); m = min(m, len - row - 1); m = min(m, len - col - 1); printf("%d ", n - m); } printf("\n"); } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Printing Pattern Using Loops
You are viewing a single comment's thread. Return to all comments →
I modified that to this: