基础斐波那契博弈
#include<stdio.h> #include<iostream> #include<cstring> #include<cmath> #include<queue> using namespace std; long long a[2000]; int main() { a[0] = 1,a[1] = 2; for(int i = 2;i < 100;i++) { a[i] = a[i-1] + a[i-2]; } int n; while(~scanf("%d",&n) && n) { bool flag = true; for(int i = 0;i < 100;i++) { if(a[i] == n) { printf("Second win "); flag = false; break; } } if(flag) printf("First win "); } return 0; }