Codeforces Beta Round #92 (Div. 2 Only) A题

来源:互联网 发布:房产软件 编辑:程序博客网 时间:2024/06/04 19:37

这道题目我不想多说什么,自己动动笔就知道了!

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(a+b<n)
    cout<<b+1<<endl;
    else if(a+b==n)
    cout<<b<<endl;
    else if(a+b>n)
    {
        
            cout<<n-a<<endl;
    }
    return 0;
}

原创粉丝点击