#include <iostream>
using namespace std;int st[200];int m = 2; //每次取石子最大的个数int n = 10; //石子的总数void test(){ //我们定义 st[i] == 0 为 N 态 ------ == 1 为 P 态 st[0] = 1; //正常游戏 for(int i = 1;i<=n;i++) { for(int j = 1;(i - j >= 0 && j <= m);j++) { st[i] |= st[i-j]; //如果有p态 则为1 } if(st[i]) {st[i] = 0 ;} //如果可以走到P态为N态 else st[i] = 1; } for(int i = 0;i<=n;i++) { cout <<"i -- st[i] "<< i <<" "<< ((st[i]) ? 'p' : 'n') << "\n"; }}int main() { int _ = 1; // cin >> _; while (_--) { test(); }}