(博弈)Simple Game --codeforces--570B

链接:

http://codeforces.com/problemset/problem/570/B

http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87813#problem/I

代码:

#include<stdio.h>
#include<string.h>

#define N 1100

int main()
{
    int n, m;
   while(scanf("%d%d", &n, &m)!=EOF)
   {
       if(n==1) ///只有1,他只能输了
       {
           printf("1
");
           continue;
       }
       if(m>n/2)
        printf("%d
", m-1);
       else
        printf("%d
", m+1);
   }
    return 0;
}
勿忘初心
原文地址:https://www.cnblogs.com/YY56/p/4731671.html