Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program symmetricPairs;
- var
- arr: array[1..10] of integer;
- i, counter: integer;
- num: integer;
- begin
- counter := 0;
- writeln('Введите 10 положительных чисел:');
- for i := 1 to 10 do
- begin
- read(num);
- if num < 0 then
- begin
- writeln('Числа не могут быть отрицательными.');
- Exit;
- end;
- arr[i] := num;
- end;
- for i := 1 to 5 do
- begin
- if arr[i] + arr[10 - i + 1] > 20 then
- counter := counter + 1;
- end;
- writeln('Количество симметричных пар с суммой больше 20: ', counter);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement