fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int32_t average(int32_t a, int32_t b) {
  5. return ((a < 0) ^ (b < 0))
  6. ? ((a + b) / 2)
  7. : (
  8. ((a < 0) ^ (a < b))
  9. ? (a + (b - a) / 2)
  10. : (b + (a - b) / 2)
  11. );
  12. }
  13.  
  14. int main() {
  15. // your code goes here
  16. return 0;
  17. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty