Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  231
Language: PASCAL
Code:
var
i,j,b,c,d,e,f,g,h:longint; n:longint;
function   mindigit(n1:longint):integer;
begin
b:=n1;
c:=9;
while b<>0 do begin
if b mod 10<c then c:=b mod 10;
b:=b div 10;
end;
mindigit:=c;
end;
function   maxdigit(n1:longint):integer;
begin
b:=n1;
c:=0;
while b<>0 do begin
if b mod 10>c then c:=b mod 10;
b:=b div 10;
end;
maxdigit:=c;
end;
begin
read(n);
writeln(mindigit(n),' ',maxdigit(n));
End.     
Comments: