- 2024-5 龙凤苑中学B班5.28
金币
- @ 2024-5-28 17:14:34
#include <bits/stdc++.h>
using namespace std;
long long a=0,n,d;
int main() {
cin>>n;
int s;
d=0;
for(int i=1;;i++){
// s=i;
for(int j=1;j<=i;j++){
a+=i;
d++;
if(d==n){
cout<<a;
return 0;
}
}
}
}
0 comments
No comments so far...