PascalABC.NET
Uses crt;
begin
Var Sum:=0;
var Arr := ArrRandom(100,100,999);
foreach var x in Arr do begin
if x mod 10 = 0 then begin
textcolor(red);
x.Print
end
else begin
Textcolor(white);
end;
if x < 500 then
Sum+=x
Println;
Println('Summ x<500 = ',sum);
end.
Результат приложил в виде скрина.
===== PascalABC.NET =====
uses System;
var a := ArrRandom(100, 100, 999);
foreach var n in a do
if n mod 10 = 0 then
Console.ForegroundColor := ConsoleColor.Red
else
Console.ResetColor;
Console.Write(n + ' ')
Writeln;
Console.WriteLine(a.Where(p -> p < 500).Sum)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
PascalABC.NET
Uses crt;
begin
Var Sum:=0;
var Arr := ArrRandom(100,100,999);
foreach var x in Arr do begin
if x mod 10 = 0 then begin
textcolor(red);
x.Print
end
else begin
Textcolor(white);
x.Print
end;
if x < 500 then
Sum+=x
end;
Println;
Textcolor(white);
Println('Summ x<500 = ',sum);
end.
Результат приложил в виде скрина.
===== PascalABC.NET =====
uses System;
begin
var a := ArrRandom(100, 100, 999);
foreach var n in a do
begin
if n mod 10 = 0 then
Console.ForegroundColor := ConsoleColor.Red
else
Console.ResetColor;
Console.Write(n + ' ')
end;
Writeln;
Console.WriteLine(a.Where(p -> p < 500).Sum)
end.