题解 | #尼科彻斯定理#

尼科彻斯定理

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

全部评论

相关推荐

2025-12-27 16:01
重庆大学 Java
蛊界Go学长林剑行:项目部分,不光要展示技术栈的熟练程度,还要有架构意识+产品意识。知道每个业务逻辑落地的成果和技术选型的思考,不然纯炫技是没意义的,毕竟你用的这些技术大概率跟大厂实际项目不垂直,面试官不一定有兴趣
简历中的项目经历要怎么写
点赞 评论 收藏
分享
哞客37422655...:这就是真实社会,没有花里胡哨的安慰,让你感受到阶级分明,不浪费彼此时间。虽然露骨但是唉
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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