// F# open System [<EntryPoint>] let main argv = let mutable sum = 0 let mutable i = 0 let array = [19..51] while i < array.Length do let value = array.Item i if 5 % value = 0 then sum <- sum + value i <- i+1 Console.WriteLine sum Console.ReadKey true |> ignore 0
// Pascal (for) var sum : integer; i: integer; begin sum := 0; i := 0; for i:=19 to 51 do begin if i mod 5 = 0 then sum := sum + i; end; writeln(sum); end.
// Pascal var sum : integer; i: integer; begin sum := 0; i := 19; while (i <= 51) do begin if i mod 5 = 0 then sum := sum + i; i := i + 1; end; writeln(sum); end.
open System
[<EntryPoint>]
let main argv =
let mutable sum = 0
let mutable i = 0
let array = [19..51]
while i < array.Length do
let value = array.Item i
if 5 % value = 0 then
sum <- sum + value
i <- i+1
Console.WriteLine sum
Console.ReadKey true |> ignore
0
// Pascal (for)
var sum : integer;
i: integer;
begin
sum := 0;
i := 0;
for i:=19 to 51 do
begin
if i mod 5 = 0 then
sum := sum + i;
end;
writeln(sum);
end.
// Pascal
var sum : integer;
i: integer;
begin
sum := 0;
i := 19;
while (i <= 51) do
begin
if i mod 5 = 0 then
sum := sum + i;
i := i + 1;
end;
writeln(sum);
end.