提交时间:2023-10-04 09:07:46

运行 ID: 104756

#include<iostream> using namespace std; int a[105]; int main() { int n , p; cin >> n >> p; int sum = p * 2; for(int i = p + 1;i <= n;i++) sum += i; cout << sum; return 0; }