#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; #ifdef Serpentine_matrix /* 方法一 思路:一个n*n矩阵,只填充上半矩阵,右上角进行填充,横坐标递减,纵坐标递增, 例如[0,0];[-1, 0]、[0, 1];[-2, 0] 、[-1, 1]、[0, 2]; [-3, 0]、[-2, 1] [-1, 2] [0, 3] ...