题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
写的真恶心
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int m = scan.nextInt();
int[] res = new int[m];
if(m%2==0){
int begin = m*m-m+1;
for(int i = 0; i<m-1; i++){
res[i] = begin + 2*i;
System.out.print(res[i]+"+");
}
System.out.print(begin+2*(m-1));
}
else{
int begin = m*m-m+1;
for(int i = 0; i<m-1; i++){
res[i] = begin + 2*i;
System.out.print(res[i]+"+");
}
System.out.print(begin+2*(m-1));
}
}
scan.close();
}
}