ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1327. Fuses

Please, help!
Posted by Shaft 15 Jul 2015 20:05
I can't understand what's wrong in my code, it write 51 instead of 50

#include <iostream>
using namespace std;

int main()
{
    unsigned short a, b, c;

    cin >> a >> b;

    c = (b - a) + 1;

    if(c % 2 == 0)
        cout << c / 2;
    else
        cout << (c / 2) + 1;  /// 1! 2 3! 4 5! 6 7! 8 9! 10 11! 12 13! 14 15!

    return 0;
}