题解 | #尼科彻斯定理#

尼科彻斯定理

https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85

include

include

include

using namespace std;

int main(){
int m;
while(cin>>m){
int tmp=mm;
if(m%2==0)//如果n为偶数
{
int tmp1=tmp-1;
int first=tmp1-(m/2-1)2;
for(int i=0;i<m-1;i++){
cout<<first+2
i<<'+';
}
cout<<first+2
(m-1)<<endl;
}
else if(m%2!=0){
int tmp1=tmp;
int first=tmp1-m/22;
for(int i=0;i<m-1;i++){
cout<<first+2*i<<'+';
}
cout<<first+2
(m-1)<<endl;
}
}
system("pause");
return 0;
}

全部评论

相关推荐

迷茫的大四🐶:自信一点,我认为你可以拿到50k,低于50k完全配不上你的能力,兄弟,不要被他们骗了,你可以的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务