#include <iostream> int main() { auto f = [](int n){for(int x = 0; x < n; ++x){for(int y = 0; y < n; ++y)std::cout << std::min(x+1 < y+1 ? x+1 : y+1,n-x < n-y ? n-x : n-y);std::cout<<std::endl;}}; f(5); return 0;}
Standard input is empty
11111 12221 12321 12221 11111
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!