Home
О нас
Products
Services
Регистрация
Войти
Поиск
Umper
@Umper
March 2022
2
20
Report
Напишите программу, которая заполняет массив из 10 элементов случайными числами на отрезке {-2,2} и находит произведение ненулевых элементов.
Please enter comments
Please enter your name.
Please enter the correct email address.
Agree to
terms of service
You must agree before submitting.
Send
Answers & Comments
elenaklon
//PascalABC.NET
//Версия 3.3.5, сборка 1650
begin
var a:=ArrRandom(10,-2,2).Println.Where(x->x<>0);
write('произведение ненулевых элементов: ',a.Aggregate(Real(1),(a,b)->a*b));
end.
5 votes
Thanks 7
Umper
спасибо)
AnonimusPro
Verified answer
Const n=10;
var a: array [1..n] of integer;
i,p: integer;
begin
for i:=1 to n do
a[i]:=random(-2,2);
writeln (a);
p:=1;
for i:=1 to n do
if a[i]<>0 then p:=p*a[i];
writeln (p)
end.
5 votes
Thanks 4
×
Report "Напишите программу, которая заполняет массив из 10 элементов случайными числами ..."
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
Helpful Links
О нас
Политика конфиденциальности
Правила и условия
Copyright
Контакты
Helpful Social
Get monthly updates
Submit
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
//Версия 3.3.5, сборка 1650
begin
var a:=ArrRandom(10,-2,2).Println.Where(x->x<>0);
write('произведение ненулевых элементов: ',a.Aggregate(Real(1),(a,b)->a*b));
end.
Verified answer
Const n=10;var a: array [1..n] of integer;
i,p: integer;
begin
for i:=1 to n do
a[i]:=random(-2,2);
writeln (a);
p:=1;
for i:=1 to n do
if a[i]<>0 then p:=p*a[i];
writeln (p)
end.