#include <iostream> using namespace std; int main(){ int n; cin>>n; int first = n*(n-1) + 1; // 第一个数 string res; for(int i = 0; i < n; ++i){ if(i > 0){ res += "+"; } res += to_string(first + 2*i); } cout<<res<<endl; }
#include <iostream> using namespace std; int main(){ int n; cin>>n; int first = n*(n-1) + 1; // 第一个数 string res; for(int i = 0; i < n; ++i){ if(i > 0){ res += "+"; } res += to_string(first + 2*i); } cout<<res<<endl; }