题解 | #尼科彻斯定理#

尼科彻斯定理

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

import java.util.Scanner;

/**
 * @Auther: Nurzat.E
 * @Date: 2022/3/19 - 03 - 19 - 19:26
 * @Description: Test02
 * @version: 1.0
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        StringBuilder s = new StringBuilder();
        int a = n * (n - 1) + 1;
        for (int i = a; i <=a+(n-1)*2; i+=2) {
            s.append(i).append("+");
        }
        System.out.print(s.substring(0, s.length() - 1));
    }
}


全部评论

相关推荐

鬼迹人途:你去投一投尚游游戏,服务器一面,第一个图算法,做完了给你一个策略题,你给出方案他就提出低概率问题,答不上当场给你挂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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