-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
12 lines (12 loc) · 1.23 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
<b>Count up the squares</b> <a class=right href="https://hyperskill.org/learn/step/6308">Open on JetBrains Academy</a>
<br><br>
<html>
<head></head>
<body>
<p>Write a program that reads from the console integers (one in a line) until <strong>their</strong> <strong>sum</strong> is equal to <strong>0</strong>. Immediately after that, it should display <strong>the sum of the squares</strong> of all the entered numbers.</p>
<p>It is guaranteed that at some point the sum of the entered numbers will be equal to 0. After that, reading is <strong>not necessary</strong> to continue.</p>
<p>In case the first integer equals to 0, just print out 0 instead of the sum of the squares.</p>
<p>For example, we are reading the numbers <samp>1, -3, 5, -6, -10, 13.</samp> At this point, we have noticed that the sum of these numbers is 0 and output the sum of their squares, not paying attention to the fact that there are still unread values.</p>
</body>
</html><br><b>Sample Input:</b><br>1<br>-3<br>5<br>-6<br>-10<br>13<br>4<br>-8<br><b>Sample Output:</b><br>340<br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 5 seconds</font><br><br>
<a href="https://hyperskill.org/learn/step/6302">Show topic summary</a>