• 个人简介

    ~该用户很懒,这里啥也没写 (´・ω・`)~ 用户不懒,所以留下了什么......

    当你想离开时,你犹豫了

    用户不是很懒了,所以用户也不是蒟​蒻

    我的码风:

    include <bits/stdc++.h>

    using namespace std;

    int a[1010][1010]; int main() { int n = 1; cin >> n; n = n; int x = 1; int y = 1; int num = 1; int way = 1; while(num <= n * n / 2 + 1){ a[x][y] = num; a[n + 1 - x][n + 1 - y] = n * n + 1 - num; if(way == 1){ x --; y ++; } else{ x ++; y --; } if(x == 0){ x = 1; way = 0; } if(y == 0){ y = 1; way = 1; } num ++; } for(int i = 1;i <= n;i++){ for(int j = 1;j <= n;j++){ cout << a[i][j] << " "; } cout << endl; } return 0; } // 蛇形矩阵

  • 最近活动

    This person is lazy and didn't join any contests or homework.
  • 最近编写的题解

    This person is lazy and didn't write any solutions.
  • Stat

  • Rating