A. 【基础】骑士的金币

    Type: Default 1000ms 128MiB

【基础】骑士的金币

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

国王将金币作为奖励,发放给忠诚的骑士。第一天,骑士收到一枚金币;之后两天(第二天和第三天)里,每天收到两枚金币;之后三天(第四、五、六天)里,每天收到三枚金币;之后四天(第七、八、九、十天)里,每天收到四枚金币……这种工资发放模式会一直这样延续下去:当连续N天每天收到N枚金币后,骑士会在之后的连续N+1天里,每天收到N+1枚金币(N为任意正整数)。 你需要编写一个程序,确定从第一天开始的给定天数内,骑士一共获得了多少金币。

Input Format

一个整数(范围1到10000),表示天数。

Output Format

骑士获得的金币数。

6
14

Hint

【来源】 noip2015普及组复赛第1题

Source

noip复赛 需要找规律的循环

课后练习3(循环结构)

Not Claimed
Status
Done
Problem
6
Open Since
2025-12-13 0:00
Deadline
2025-12-20 23:59
Extension
24 hour(s)