Current location - Loan Platform Complete Network - Big data management - VFP:Input a numeric data from keyboard, find out the largest and smallest number of digits in that data.
VFP:Input a numeric data from keyboard, find out the largest and smallest number of digits in that data.
clear

input "Please enter a number:" to x

a=0

b=9

x=alltrim(str(x))

k=len(x)

for i=1 to k

m=substr(x,i,1)<

n=int(val(m))

if n>a

a=n

endif

if n<b

b=n

endif

endfor

endfor

"Largest number:",a

"Smallest number:" ,b