28. 平均整数值

ALICE

include

include

include

int Mean(int a, int b) {
float n;
n=(a+b)/2;
if(n>=0)n=floor(n);
else n=ceil(n);
return n;
}

int main() {
int a, b;
scanf(“%d%d”, &a, &b);
printf(“%d\n”, Mean(a, b));
return 0;
}

你当前正在回复 博客/题目
存在问题!