解题思路:
注意事项:
参考代码:
#include<iostream>
using namespace std;
#include<vector>
int main() {
int m = 0;
cin >> m;
vector<int> arr;
int start = m * m - (m - 1);
int end = m * m + (m - 1);
for (int i = start; i <= end; i += 2) {
arr.push_back(i);
}
cout << m << "*" << m << "*" << m << "=" << m * m * m << "=";
for (int i = 0; i < m; i++) {
cout << arr[i] ;
if (i != m - 1) {
cout << "+";
}
}
cout << endl;
return 0;
}
0.0分
0 人评分