Ответ:
Pascal:
var n, i: integer;
begin
for n := 1 to 1000 do
if (n mod 17 = 0) and (n mod 10 = 3) then
i := i + n;
writeln(i);
end.
Python:
n, i = 0, 0
for n in range(1,1001):
if n % 17 == 0 and n % 10 == 3:
i += n
print(i)
Результат: 2465
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
Pascal:
var n, i: integer;
begin
for n := 1 to 1000 do
if (n mod 17 = 0) and (n mod 10 = 3) then
i := i + n;
writeln(i);
end.
Python:
n, i = 0, 0
for n in range(1,1001):
if n % 17 == 0 and n % 10 == 3:
i += n
print(i)
Результат: 2465