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