杨辉三角的变形_牛客题霸_牛客网 (nowcoder.com)
#include <iostream> using namespace std; int main() { //这个树的偶数规律为 -1 -1 2 3 2 4 2 3 2 4 int n=0; cin>>n; if(n<=2) { cout<<-1; } else { //用下标去取模 if(n%4==3||n%4==1) cout<<2; else if(n%4==2) cout<<4; else cout<<3; } return 0; }
标签:std,牛客,int,---,变形,杨辉三角 From: https://www.cnblogs.com/LonelyMoNan/p/16750781.html