Midpoint interval-solution:
#include < stdio.h >
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d",&a,&b); //a=3,b=13
c=a+(b-a)/2;
/*
the length of the interval is b, the mean length is (b-a) / 2, so that we get to the regular number,
to the initial one and add the middle of the length of the interval
c=3+(13-3)/2=3+5=8
*/
printf("%d",c);
return 0;
}
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d",&a,&b); //a=3,b=13
c=a+(b-a)/2;
/*
the length of the interval is b, the mean length is (b-a) / 2, so that we get to the regular number,
to the initial one and add the middle of the length of the interval
c=3+(13-3)/2=3+5=8
*/
printf("%d",c);
return 0;
}