思路:
代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a1,res;
string str;
while (cin >> n){
str = "";
a1 = n * n - n + 1;
for (int i = 0; i < n;i++){
str += to_string(a1 + 2 * i);
if(i==n-1){
break;
}
str += "+";
}
cout << str << endl;
}
return 0;
}