题解 | #尼科彻斯定理#

尼科彻斯定理

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;
}

全部评论

相关推荐

龙珠传说:nb,公务员解约不需要支付违约金吧
点赞 评论 收藏
分享
05-26 09:07
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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