fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x, y, r = 0;
  6. cin >> x >> y;
  7. if (x < y) {
  8. for (; x < y; x++) if (x % 2 != 0) r += x;
  9. } else {
  10. for (; y < x; y++) if (y % 2 != 0) r += y;
  11. }
  12. cout << r << endl;
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/334198/101
Success #stdin #stdout 0s 15232KB
stdin
6
-5
stdout
0