acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 这段代码有什么问题?

    这段代码有什么问题? '''cpp '''cap #include <bits/stdc++.h> using namespace std; int main() { int n, a[105][105], num = 1; cin >> n; for (int i = 1; i <= n; i ++) { for (int j = 1; j <= n; j ++) a[i][j] = num; num ++; } for (int i = 1; i <= n; i ++) { if (i % 2 == 0) { int b[105]; num = 1; for (int j = n; j > 0; j --) { b[num] = a[i][j]; num ++; } for (int j = 1; j <= n; j ++) a[i][j] = b[j]; } } for (int i = 1; i <= n; i ++) { for (int j = 1; j <= n; j ++) cout << a[i][j] << " "; cout << endl; } } '''

    userId_undefined

    ‮🐱‍🚀

    尊贵铂金
    122阅读
    43回复
    4点赞
首页