#include <stdio.h>
void print_palindrome_triangle_pattern(int rows) {
int count = 0;
for (int i = 0; i < 2 * rows; i = i + 2) {
for (int j = 0; j <= i; j++) {
printf("%d ", 1 + count);
if (j < i / 2)
count++;
else
count--;
}
count = 0;
printf("\n");
}
}
int main() {
print_palindrome_triangle_pattern(7);
return 0;
}
/*
run:
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
1 2 3 4 5 6 5 4 3 2 1
1 2 3 4 5 6 7 6 5 4 3 2 1
*/