Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96373 | 冯诚阳 | 画DNA | C++ | Presentation Error | 35 MS | 272 KB | 478 | 2024-11-07 18:16:00 |
#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; }