Найти сумму ряда S = 15 + 16 + 17 + ... + n.

0 голосов
269 просмотров

Найти сумму ряда S = 15 + 16 + 17 + ... + n.


Информатика (306 баллов) | 269 просмотров
0

написать программу

0

cin>>n; for(int i=15;i

Дан 1 ответ
0 голосов
Правильный ответ
С++
#include
using namespace std;
main()
{
int a, s;
cin >> a;
for(int i = 15; i <= a; i++)<br> s += i;
cout << s;<br>}
Python
a = int(input())
s = 0
for i in range(15, a + 1):
    s += i
print(s)
Pascal
var a, s, i: integer;
begin
read(a);
for i := 15 to a do s += i;
write(s);
end.
(6.3k баллов)