Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- uses crt;
- function maximal(n:integer):boolean;
- var
- nCopia,i,cifras:integer;
- begin
- maximal:=true;
- cifras:=0;
- nCopia:=n;
- repeat
- cifras:=cifras+1;
- nCopia:=nCopia div 10;
- until nCopia=0;
- for i:=1 to cifras-1 do
- if ((n div 10)mod 10)<(n mod 10) then
- maximal:=false;
- end;
- var
- num:integer;
- begin
- read(num);
- if maximal(num) then
- writeln('es maximal')
- readkey
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement