Home
О нас
Products
Services
Регистрация
Войти
Поиск
vishnya0312
@vishnya0312
July 2022
2
8
Report
Помогите, пожалуйста. Задан массив А(n). Вычислить: а1 + 2*а2 +...+ n*an
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
monicgh
Const n=10;
var a:array[1..n] of integer;
s,i:integer;
begin
Randomize;
for i:=1 to n do begin
a[i]:=random(51);
write(a[i],' ');
end;
writeln;
s:=0;
for i:=1 to n do s:=s+i*a[i];
writeln('s = ',s);
end.
Пример:
17 30 10 32 46 5 43 7 40 25
s = 1462
0 votes
Thanks 1
vishnya0312
Спасибо
petyaGavrikov
Verified answer
Summ = 0
for i in range(1, 1+n):
summ += i*A[i-1]
print(summ)
2 votes
Thanks 1
vishnya0312
Спасибо
petyaGavrikov
Пожалуйста.
vishnya0312
Подскажите, пожалуйста, это Java Script?
petyaGavrikov
Это паскаль.
vishnya0312
А языком Java Script сможете, пожалуйста, помочь?
petyaGavrikov
Оформляйте задачу. Посмотрю.
vishnya0312
А как оформить?
×
Report "Помогите, пожалуйста. Задан массив А(n). Вычислить: а1 + 2*а2 +...+ n*an..."
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
var a:array[1..n] of integer;
s,i:integer;
begin
Randomize;
for i:=1 to n do begin
a[i]:=random(51);
write(a[i],' ');
end;
writeln;
s:=0;
for i:=1 to n do s:=s+i*a[i];
writeln('s = ',s);
end.
Пример:
17 30 10 32 46 5 43 7 40 25
s = 1462
Verified answer
Summ = 0for i in range(1, 1+n):
summ += i*A[i-1]
print(summ)