Untitled
#include <iostream> using namespace std; int main() { unsigned long long a, b; cin >> a >> b; unsigned long long n = b - a + 1; unsigned long long tong = (a + b) * n / 2; cout << tong; return 0; }
Leave a Comment
#include <iostream> using namespace std; int main() { unsigned long long a, b; cin >> a >> b; unsigned long long n = b - a + 1; unsigned long long tong = (a + b) * n / 2; cout << tong; return 0; }