Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96372 冯诚阳 画DNA C++ Presentation Error 34 MS 276 KB 478 2024-11-07 18:13:35

Tests(0/10):


Code:

#include <iostream> using namespace std; int main() { int n, m, cnt; cin >> cnt; while (cnt--) { cin >> n >> m; bool flag = true; while (m--) { for (int i = 0; i < n; i++) { if (i != 0 || flag) { for (int j = 0; j < n; j++) { if (j == i || j == n - i - 1) { cout << "X"; } else cout << " "; } flag = false; cout << endl; } } if (cnt != 0) cout << endl; } } return 0; }