Предмет: Информатика, автор: ttttzdvjj

Прошу кто знает Паскаль. дано натуральное число n задать массив из n элементов по формуле a = 2 sin i. Вывести элементы массива. Найти сумму отрицательных элементов массива.

Ответы

Автор ответа: Tom126666
0
program f1;
const n=5;
var a:array [1..n] of real;
i: integer;
s:real;
begin
for i:=1 to n do
readln(a[i]);
for i:=1 to n do begin
a[i]:=2*sin(i);
if a[i]<0 then s:=s+a[i];
end;
writeln('s=',s);
for i:=1 to n do
writeln(a[i]);
end.
Похожие вопросы
Предмет: Математика, автор: scooteronelove
Предмет: Биология, автор: kn555347
Предмет: Английский язык, автор: sokolenkozena5
Complete the sentences below with the correct forms of the verbs in brackets. 1. These people ________ (wait) for you for 2 hours. 2. The Headmaster says he ______(think) about it for a long time but he hasn't decided yet. 3. I wonder what they ______ (discuss) since 9 a.m. 4. She _______ (come) to this square for years. 5. The children _______ (play) in the garden since it stopped raining. 6.I know you went to France 5 years ago. What ______ (you /do) there? 7. Tom ____ (play) football for only a few months but he's already very good. 8. I ______ (watch) my favourite TV programme for half an hour. 9. The pupil _______ (learn) the new words for an hour, but he doesn't remember them. 10. Jane _______ (write) letters to her friends since morning. 11. We ______ (walk) ten kilometres already. 12. We are very tired. We _____ (walk) for three hours. 13. I'm on a diet, I ______ (eat) nothing but fruit for the whole week. 14. He ______ (just/eat) two big sandwiches and chocolate ice-cream. 15. The child _____ (sleep) since three o'clock. It's time he woke up. 16. _______ (you / hear) the news? Tom and Ann got married! 17. The students _______ (work) very well this term. I hope they will get good marks. 18. ________ (you/ see) my handbag anywhere? I ________ (look) for it for half an hour. 19. Tom and Ann _______ (always / buy) lottery tickets but they ______ (never/win). 20. Mary ______ (revise) the rules since 8 a.m. 21. -________ (it/still/rain) in London? No, it _______ (already/stopped). - But in Brighton it ______ (rain) all day long. 22. I suppose I _______ (lose) my mobile phone. ______ (you / see) it anywhere? 23. Alan is a friend of mine. We ______ (know) each other since we (graduare) from the University. We _____ (work) together for five years.​
Предмет: История, автор: аринакузьменко