You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter-05-loops.md
+23-23Lines changed: 23 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -298,64 +298,64 @@ After these changes the structure of the project should look like this:
298
298
299
299
For each subsequent exercise we will create a new class in the way described above.
300
300
301
-
### Задача: Елемент, равен на сумата на останалите
301
+
### Problem: Element Equal to the Sum of the Rest
302
302
303
-
Да се напише програма, която въвежда **n цели числа**и проверява дали сред тях съществува число, което е равно на сумата на всички останали. Ако има такъв елемент, се отпечатва **"Yes" + неговата стойност**, в противен случай - **"No" + разликата между най-големия елемент и сумата на останалите** (по абсолютна стойност).
303
+
Write a program that inputs **n whole numbers**and checks whether among them there is a number equal to the sum of all the rest. If there is such an element, print **"Yes" + its value**, otherwise - **"No" + the difference between the largest element and the sum of the rest** (by absolute value).
Трябва да изчислим **сумата**на всички елементи, да намерим**най-големия**от тях и да проверим търсеното условие.
317
+
We must calculate the **sum**of all elements, find the**largest**of them and check the condition.
318
318
319
-
#### Тестване в Judge системата
319
+
#### Testing in the Judge system
320
320
321
-
Тествайте решението си тук: [https://judge.softuni.bg/Contests/Practice/Index/655#9](https://judge.softuni.bg/Contests/Practice/Index/655#9).
321
+
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/655#9](https://judge.softuni.bg/Contests/Practice/Index/655#9).
322
322
323
323
324
-
### Задача: четни / нечетни позиции
324
+
### Problem: Odd / Even Position
325
325
326
-
Напишете програма, която чете **n числа**и пресмята**сумата**, **минимума**и**максимума**на числата на **четни**и**нечетни**позиции (броим от 1). Когато няма минимален / максимален елемент, отпечатайте**"No"**.
326
+
Write a program that reads **n numbers**and calculates**the sum**, the **min**and**max**values of the numbers on **even**and**odd**positions (counted from 1). If there is no min / max element, print**"No"**.
Задачата обединява няколко предходни задачи: намиране на**минимум**, **максимум**и **сума**, както и обработка на елементите от**четни и нечетни позиции**. Припомнете си ги.
339
+
The task combines some of the previous tasks: finding the**min**, **max**and the **sum**, as well as processing elements on**even and odd positions**. Check your solutions of the previous tasks again.
340
340
341
-
В тази задача е по-добре да се работи с **дробни числа** (не цели). Сумата, минимумът и максимумът също са дробни числа. Трябва да използваме **неутрална начална стойност**при намиране на минимум / максимум, например **1000000000.0**и**-1000000000.0**. Ако получим накрая неутралната стойност, печатаме**“No”**.
341
+
In the current task it is better to work with **fractions** (not integers). The sum, the min and the max value will also be fractions. We have to use **neutral starting value**in finding the min / max value, for example **1000000000.0**and**-1000000000.0**. If the end result is equal to the neutral value, we will print**“No”**.
342
342
343
-
#### Тестване в Judge системата
343
+
#### Testing in the Judge system
344
344
345
-
Тествайте решението си тук: [https://judge.softuni.bg/Contests/Practice/Index/655#10](https://judge.softuni.bg/Contests/Practice/Index/655#10).
345
+
Test your solution here: [https://judge.softuni.bg/Contests/Practice/Index/655#10](https://judge.softuni.bg/Contests/Practice/Index/655#10).
346
346
347
347
348
-
### Задача: еднакви двойки
348
+
### Problem: Equal Pairs
349
349
350
-
Дадени са**2 \* n числа**. Първото и второто формират **двойка**, третото и четвъртото също и т.н. Всяка двойка има **стойност** – сумата от съставящите я числа. Напишете програма, която проверява **дали всички двойки имат еднаква стойност**.
350
+
There are**2 \* n numbers**. The first and the second form a **pair**, the third and the fourth number also, and so on. Each pair has a **value** – the sum of its numbers. Write a program that checks **if all pairs have equal values**.
351
351
352
-
В случай, че е еднаква отпечатайте **"Yes, value=…" + стойността**, в противен случай отпечатайте**максималната разлика**между две последователни двойки в следния формат - **"No, maxdiff=…" + максималната разлика**.
352
+
In case the value is the same, print **"Yes, value=…" + the value**, otherwise print the **maximum difference**between two consecutive pairs in the following format - **"No, maxdiff=…" + the maximum difference**.
353
353
354
-
Входът се състои от число**n**, следвано от**2*n цели числа**, всички по едно на ред.
354
+
The input consists of number**n**, followed by**2*n integers** one per line.
0 commit comments