Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions Module2.5/practice/🟣hard/[hard]03_task_while.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,32 @@

### Решение задачи

```python
# TODO: you code here...
```
m = int(input('m: '))

n = 1
while n < m:
i = 1
n_div_sum = 0
while i < n:
if n % i == 0:
n_div_sum += i
i += 1

j = 1
n_div_sum_div_sum = 0
while j < n_div_sum:
if n_div_sum % j == 0:
n_div_sum_div_sum += j
j += 1
if n != n_div_sum and n == n_div_sum_div_sum and n_div_sum <= m and n <= n_div_sum:
print(n, n_div_sum)
n += 1


---

### Данные для самопроверки

| Дано | Результат |
| :---: | --- |
| 300 | 220 284 |
| 300 | 220 284 |