math.abs是错的
#include<iostream> #include<math.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; int m = (a + b + abs(a-b)) / 2; cout<<(c + m + abs(c-m)) / 2<<" eh o maior"; return 0; }