fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long a, b, n, S;
  6. cin >> a >> b;
  7. n = b - a + 1;
  8. S = (a + b) * n / 2;
  9. cout << S;
  10. return 0;
  11. }
Success #stdin #stdout 0s 15232KB
stdin
478 653
stdout
99528