/
anton.buldygin
/
Contacts_Java
Обзор
Документация
Войти
/
anton.buldygin
/
Contacts_Java
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Topics/Command/Forex Broker/task.html
4 строки
1 KB
AntonBuldygin
Initial commit
19 дек 2023, 15:38
19 дек 2023, 15:38
bed9366
Код
Авторство
О чём код?
<h2>Forex Broker</h2> <div class="step-text"> <p></p><p>Suppose you are building a <strong>Forex Broker</strong> application. Forex broker has two commands which are <code class="java">buy</code> and <code class="java">sell</code>. The user gives an input sequence which is the amount of money (<code class="java">Option</code>) to be bought and sold. If the user gives a positive number it is to be bought. If the user gives a negative number, that amount must be sold. </p><p>Use the following guidelines:</p><ul><li><p>Don't change the provided code.</p></li><li><p>If the user amount is X>0, the X amount must be bought. The <code class="java">buy</code> command must print <code class="java">X was bought</code>.</p></li><li><p>If the user amount is X<0, the X amount must be sold. The <code class="java">sell</code> command must print <code class="java">X was sold</code>.</p></li><li><p>The user will give only three inputs. </p></li></ul><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">5 -8 10</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">5 was bought<br>-8 was sold<br>10 was bought</code></pre><br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 5 seconds</font><br><br> </div>