标签:++ clu mes cin ios stream name namespace 矩形
一:解题思路
二:完整代码示例 (C++版和Java版)
C++代码:
#include <iostream> using namespace std; int main() { int k = 0; int N = 0; int num = 0; while (cin >> k) { num = 1; for (int i = 0; i < N; i++) { num += i; k = num; for (int j = 0; j < N - i; j++) { cout << k; if (j != N - 1 - i) cout << " "; else cout << endl; k += i + 2 + j; } } } return 0; }
标签:++ clu mes cin ios stream name namespace 矩形
原文地址:https://www.cnblogs.com/repinkply/p/13442568.html