题目不给用公式,但是
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0; cin>>n; sum=(n+1)*n/2; cout<<sum<<endl; return 0; }
过了