solution.cpp 248 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
using namespace std;
int main()
{
    int m, n, a;
    while (cin >> n >> m)
    {
        a = m - n + 2;
        a = a / 2;
        if (n % 2 != 0 && m % 2 == 0)
            a++;
        cout << a << endl;
    }
    return 0;
}