题解 | #尼科彻斯定理#简单暴力输出
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int temp = 1;
for (int i = 0;i<n;i++){
temp += 2*i;
}
for (int i = 0; i < n-1; i++) {
System.out.print((temp+2*i)+"+");
}
System.out.print(temp+2*(n-1));
}
}
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int temp = 1;
for (int i = 0;i<n;i++){
temp += 2*i;
}
for (int i = 0; i < n-1; i++) {
System.out.print((temp+2*i)+"+");
}
System.out.print(temp+2*(n-1));
}
}