题解 | #尼科彻斯定理#
尼科彻斯定理
https://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while (sc.hasNext())
{
int n = sc.nextInt();
String[] strs = new String[n];
int k = n*n-n+1;
int j = 0;
for (int i = 0; i < n; i++)
{
strs[i] = String.valueOf(k+j);
j+=2;
}
System.out.println(String.join("+",strs));
}
}
}
#利用数学公式推算的#
科大讯飞公司氛围 469人发布