程序:
#include<stdio.h>
int main()
{
int a, b;
int avg = 0;
scanf("%d%d", &a, &b);
avg = (a + b) >> 1;
//右移一位相当于除以2
printf("%d\n",avg);
return 0;
}

 

结果:
6 8
7