===== PascalABC.NET =====
1)
begin
var (a, b) := ReadInteger2('Введите a, b:');
var s := 0;
for var i := a to b do
if i mod 2 = 0 then
s += i;
Println(s)
end.
2)
Println(s / (b - a + 1))
1) begin
2) begin
Конец, ну как-то так
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
===== PascalABC.NET =====
1)
begin
var (a, b) := ReadInteger2('Введите a, b:');
var s := 0;
for var i := a to b do
if i mod 2 = 0 then
s += i;
Println(s)
end.
2)
begin
var (a, b) := ReadInteger2('Введите a, b:');
var s := 0;
for var i := a to b do
s += i;
Println(s / (b - a + 1))
end.
1) begin
var (a, b) := ReadInteger2('Введите a, b:');
var s := 0;
for var i := a to b do
if i mod 2 = 0 then
s += i;
Println(s)
end.
2) begin
var (a, b) := ReadInteger2('Введите a, b:');
var s := 0;
for var i := a to b do
s += i;
Println(s / (b - a + 1))
Конец, ну как-то так