链接:

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\n");
           continue;
       }
       if(m>n/2)
        printf("%d\n", m-1);
       else
        printf("%d\n", m+1);
   }
    return 0;
}

 

posted on 2015-08-15 08:29  栀蓝  阅读(201)  评论(0编辑  收藏  举报

levels of contents