题解 | #杨辉三角的变形#
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
#include <iostream>
using namespace std;
int Res(int n)
{
if(n==1||n==2)
return -1;
if(n%2!=0)
return 2;
if(n%4==0)
return 3;
return 4;
}
int main()
{
int N;
cin>>N;
cout<<Res(N)<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")

查看3道真题和解析