题解 | #[NOIP2015]金币#
[NOIP2015]金币
http://www.nowcoder.com/practice/8f71f5670e6a45118d24d13868a2da9e
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k=sc.nextInt(); int sum=0,day=0; for(int i=1;i<=k;i++) { for(int j=1;j<=i;j++) { sum+=i; day++; if(day==k){ System.out.println(sum); break; } } } } }