fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int a, b, c = 0;
  7. a = 3;
  8. b = 4;
  9.  
  10. if ((a + b) % 2 == 1)
  11. c = ((a+b)/2) + 1;
  12. else
  13. c = (a+b)/2;
  14.  
  15. cout << c;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
4