题解 | #编排字符串#
编排字符串
https://www.nowcoder.com/practice/42c0673f04b34f66ae236a1cb7995532
#include <iostream> #include <vector> using namespace std; int n; vector<string>s; string a; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a; s.push_back(a); for (int j = i; j >= max(0, i - 3); j--) { cout << i - j + 1 << "=" << s[j]; if(j != 0) cout << " "; } cout << endl; } }