题解 | #尼科彻斯定理#
尼科彻斯定理
http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85
莫名其妙
import java.math.*;
//import java.common-lang3;
public class Main{
public static void main(String[]args){
Scanner input = new Scanner(System.in);
while(input.hasNextInt()){
int a = input.nextInt();
String[] ans = new String[2*a-1];
int b = a*a;
int hal = 0;
int fir = 0;
if(b%2 == 1){
fir = b + 1 - a;
}else{
fir = b - a + 1;
}
ans[0] = String.valueOf(fir);
for(int i = 1; i <= (a-1)*2; i=i+2){
ans[i] = "+";
ans[i+1] = String.valueOf(fir+ (i+1));
}
for(int i = 0; i < a*2-1; i++){
System.out.print(ans[i]);
}
System.out.println();
}
}
}