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

Нужна программа в Паскале.

 С клавиатуры вводятся значения переменной x. Найдите сумму только а=положительных элементов и их число.

Ответы

Автор ответа: Megacoocker
0
program test;
uses crt;
var x,n,sum,i:integer;
begin
clrscr;
 write('Input x ');readln(x);
 for i:=1 to x do
  begin
   write('Input number',i,' '); readln(n);
   if n>0 then sum:=sum+n;
  end;
writeln(sum);
readln;
end.

Похожие вопросы
Предмет: Английский язык, автор: PosTaLtop1gg
ПОМОГИТЕ ПОЖАЛУЙСТА!!
Test
1. Fill in:·sociable, curious, fit, slim, curly,·creative
1. Tom often goes to the gym. He is very ______.
2. She has green eyes and long ______ hair.
3. Your paintings are amazing. You are really very _________.
4. Betty has a lot of friends. She's very _____.
5. Don't be so _________! If he wants to tell you what happened he will.
6. Lily is a model. She is tall and ________.

2. Choose the odd word out
1. bald – young – teenager – elderly
2. slim – plump – freckles – well-built
3. spiky – wavy – curly – middle-aged
4. pretty- ugly – tall – cute

3. Choose and underline the correct word
1. I am talking about the girl who/which is sitting on the sofa.
2. This is the skate-park where/which people come to skateboard.
3. My mum made a cake which/who tasted really delicious.
4. The girl who/whose hair is very long is my elder sister.
5. 2001 was the year when/where we played in the chess tournament.

4. Choose and underline the correct word
1. I found the book really bored/boring.
2. Dad said he was really disappointed/disappointing in us.
3. The lesson was quite interested/interesting.
4. Jane is always tired/tiring after work.
5. Jack is scared/scaring of spiders.

5. Put the adjectives into the correct order
1. a(n) (English / nice / middle-aged) writer
2. a(n) (Japanese / young / interesting) student
3. a (famous / Greek / well-built) boxer
4. a( tall / French / sociable) actor
5. a(n) (talented / teenage / Italian) artist

6. Complete the sentences using: back, for, away, with, up.
1. He was famous _________ his music.
2. Give me ________ my skateboard!
3. Lilly gave _________ fencing two years ago because of a bad injury.
4. Sarah gave _________ sweets to her friends.
5. He can’t cope _______ his problems.