Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab1_2;
- uses
- SysUtils;
- var
- I,N,Comp:integer ;
- IsCorrect:boolean;
- begin
- writeln('Данная программа находит произведение P=2*4*6*8..*2*n;');
- repeat
- IsCorrect:=true;
- try
- writeln('Введите число n');
- readln(n);
- except
- IsCorrect:=false ;
- end;
- if ((n<0) or (n>9)) then
- IsCorrect:=false;
- if (NOT IsCorrect) then
- begin
- writeln('Введите число большее 4 и меньшее 10');
- end;
- until (IsCorrect=true);
- Comp:=1;
- for i:=2 to 2*n do
- if i mod 2=0 then
- Comp:=comp*i;
- writeln('Произведение равно ',Comp);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement