题解 | #杨辉三角的变形#
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
//n给的太大了所以需要找规律 #include <stdio.h> #include <string.h> int main() { int n=0; scanf("%d",&n); int arr[4]={2,3,2,4}; if(n<=2) printf("-1\n"); else { int k=(n-3)%4; printf("%d\n",arr[k]); } return 0; }