题解 | #杨辉三角的变形#掌握规律后,可以不需要比对偶数值
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
import java.util.*; public class Main { public static void main(String[] args) { Scanner fzhinput = new Scanner(System.in); int n = fzhinput.nextInt(); if(n<=2&&n>=1){ System.out.print(-1); } else if(n%2==1&&n>2){ System.out.print(2); } else{ if(n%4==0){ System.out.print(3); } else{ System.out.print(4); } } } }