#include <iostream>
using namespace std;
int main()
{
int a, b, f = 0;
cin >> a >> b;
if (a % 2 == 1){ a += 1; }
int r = a;
while (r <= b)
f++;
r += 2;
}
cout << f;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main()
{
int a, b, f = 0;
cin >> a >> b;
if (a % 2 == 1){ a += 1; }
int r = a;
while (r <= b)
{
f++;
r += 2;
}
cout << f;
}