模拟出每天骑士获得的金币,加起来
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,j=0,s=0,bj=1;
cin>>n;
for(i=1;i<=n;i++){
j++;
s=s+bj;
if(j==bj){
bj++;
j=0;
}
}
cout<<s;
}
标签:std,NOIP,++,模拟出,bj,金币,int,2015
来源: https://www.cnblogs.com/wangjunlong9948/p/16581943.html