-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
19 lines (19 loc) · 1.48 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<b>Lucky ticket</b> <a class=right href="https://hyperskill.org/learn/step/7927">Open on JetBrains Academy</a>
<br><br>
<html>
<head></head>
<body>
Lucky tickets are a kind of mathematical entertainment. A ticket is considered lucky if the sum of the first 3 digits coincides with the sum of the last 3 digits of the ticket number.
<p></p>
<p>You are supposed to write a program that checks whether the two sums are equal. The code snippet below displays <code class="java">"Lucky"</code> if they do and <code class="java">"Ordinary"</code> otherwise.</p>
<p>However, some parts of the code are missing. Fill in the blanks to make it work!</p>
<p><strong>Input: </strong>a string of 6 digits.</p>
<p><strong>Output:</strong> either <code class="java">"Lucky"</code> or <code class="java">"Ordinary"</code> (without quotes).</p>
<p><button class="btn-sm btn-outline-secondary" onclick="getElementById('hint-678').style.display='inline'"> Hint </button> </p>
<div id="hint-678" style="display:none;">
Make sure that you are NOT concatenating strings. To do this, convert each digit in the ticket number to an integer.
</div>
<p></p>
</body>
</html><br><b>Sample Input:</b><br>090234<br><b>Sample Output:</b><br>Lucky<br><br><b>Sample Input:</b><br>123456<br><b>Sample Output:</b><br>Ordinary<br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<a href="https://hyperskill.org/learn/step/5872">Show topic summary</a>