题解 | #[NOIP2015]金币#
[NOIP2015]金币
http://www.nowcoder.com/practice/8f71f5670e6a45118d24d13868a2da9e
#include<stdio.h> int main() { int day; scanf("%d",&day); int i=0,j=0,sum=0,count=0;//count统计经过的天数 for(i=1;count<day;i++) { for(j=0;j<i;j++) { sum+=i; count++; if(count>=day) break; } } printf("%d",sum); return 0; }