Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- long double sum=0;
- long double a, n;
- cin>>a;
- cin>>n;
- for(int i = a-1; i < n; i++ )
- {
- sum+=a;
- a+=1;
- }
- cout<<fixed<<setprecision(0)<<sum<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement