题解 | #杨辉三角的变形#抄大佬代码
杨辉三角的变形
http://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
if(n==1 || n==2){
System.out.println(-1);
}
else if(n%4==3 || n%4==1){
System.out.println(2);
}
else if(n%4==0){
System.out.println(3);
}
else if(n%4==2){
System.out.println(4);
}
}
}
}