1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2023-12-09 18:53:53 +08:00
parent c9b1bf36a8
commit 9bc4722a45
349 changed files with 15897 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<p>请设计一个机械累加器,计算从 1、2... 一直累加到目标数值 <code>target</code> 的总和。注意这是一个只能进行加法操作的程序不具备乘除、if-else、switch-case、for 循环、while 循环,及条件判断语句等高级功能。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong> target = 5
<strong>输出:&nbsp;</strong>15
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong> target = 7
<strong>输出:&nbsp;</strong>28
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= target&nbsp;&lt;= 10000</code></li>
</ul>
<p>&nbsp;</p>