fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. #define FOR(i,a,b) for(int i=a; i<=b; i++)
  7.  
  8. typedef long long LL;
  9.  
  10. int main()
  11. {
  12. double A,B;
  13. LL a,b;
  14.  
  15. cin>>A>>B;
  16.  
  17. a = ceil(A);
  18. b = floor(B);
  19.  
  20. LL t = 0;
  21.  
  22. FOR(i,a,b)
  23. {
  24. t += i*i;
  25. }
  26.  
  27. cout<<t <<endl;
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0s 3460KB
stdin
0.3 2.89
stdout
5