|  | 
|  | 
| back to board | Please, help! Posted by Shaft  15 Jul 2015 20:05I 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;
 }
 | 
 | 
|