Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Parne, neparne min a max
- program operaciesciframi;
- {$APPTYPE CONSOLE}
- uses SysUtils;
- var c,pc,nc,max,min:byte;
- x:word;
- begin
- write('Zadajte cislo: ');
- readln(x);
- pc:=0;
- nc:=0;
- max:=0;
- min:=255;
- while x<>0 do
- begin
- c:= x mod 10;
- x:= x div 10;
- if c mod 2 = 0 then pc:=pc+1;
- if c mod 2 <> 0 then nc:=nc+1;
- if c > max then max:=c;
- if c < min then min:=c;
- end;
- writeln('MAX: ',max);
- writeln('MIN: ',min);
- writeln('PAR: ',pc);
- writeln('NEPAR: ',nc);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment