Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- var
- a,b,f:integer;
- c:string;
- begin
- //Значение переменной a не было объявлено
- a := 0;
- textcolor(white);
- Write('Введите ');
- textcolor(yellow);
- write ('МАКСИМАЛЬНОЕ');
- textcolor(white);
- writeln(' значение: ');
- textcolor(green);
- readln(b);
- textcolor(white);
- write('Введите ');
- textcolor(yellow);
- write ('ТИП ');
- textcolor(white);
- write('чисел ');
- textcolor(red);
- writeln('(чётн\нечётн):');
- textcolor(green);
- read(c);
- b:=b-1;
- if c = 'чётн' then f:= 0;
- if c = 'нечётн' then f:= 1;
- while a <=b do begin;
- a:=a+1;
- textcolor(yellow);
- //Pascal это не JS, чтобы складывать строки плюсиком
- if a mod 2 = f then write(a, '; ');
- end;
- textcolor(green);
- writeln('');
- writeln('Все числа выведены.');
- textcolor(lightgray);
- end.
Advertisement
Add Comment
Please, Sign In to add comment