题解 | #杨辉三角的变形#
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
#include <stdio.h>
int wan(long int n)
{
    if(n==1||n==2)
    {
        return -1;
    }else if(n%2==1)
    {
        return 2;
    }else if(n%4==0)
    {
        return 3;
    }else{
        return 4;
    }
}
int main() {
    long int n;
    scanf("%d",&n);
    int result=wan(n);
    printf("%d\n",result);
    return 0;
}


查看15道真题和解析