Advertisement
Guest User

Untitled

a guest
May 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. program Project1;
  2. uses crt;
  3. function maximal(n:integer):boolean;
  4. var
  5. nCopia,i,cifras:integer;
  6. begin
  7. maximal:=true;
  8. cifras:=0;
  9. nCopia:=n;
  10. repeat
  11. cifras:=cifras+1;
  12. nCopia:=nCopia div 10;
  13. until nCopia=0;
  14. for i:=1 to cifras-1 do
  15. if ((n div 10)mod 10)<(n mod 10) then
  16. maximal:=false;
  17. end;
  18. var
  19. num:integer;
  20.  
  21. begin
  22. read(num);
  23. if maximal(num) then
  24. writeln('es maximal')
  25.  
  26. readkey
  27. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement