clear
num=9876543210123456
for lnI=len(transform(num))-1 to 0 step -1
?lnI,floor(num/10^(lnI))
num=mod(num,10^(lnI))
endfor
MessageBox(dx(987600004321))
Function dx
lparameters Num
z1="分角元拾佰仟万拾佰仟亿拾佰仟"
z2="零壹贰叁肆伍陆柒捌玖"
Num=Int(Num*100)
*MessageBox(num)
lcdx=""
For lnI=Len(Alltrim(Str(Num,16)))-1 to 0 step -1
lcdx=lcdx+Substr(z2,int(Num/10^lnI)*2+1,2)
lcdx=lcdx+Substr(z1,lnI*2+1,2)
Num=MOD(Num,10^l...
messagebox(iif(isPrime(2)=.t.,"质数","非质数"))
FUNCTION isPrime(n)
LOCAL i
IF n <= 3
RETURN n > 1
ENDIF
IF (n % 2 == 0) OR (n % 3 == 0)
RETURN .F.
ENDIF
i = 5
DO WHILE i * i <= n
IF (n % i == 0) OR (n % (i + 2) == 0)
RETU...
nDigit=0
for lnI=1 to 10
nDigit=nDigit+log10(lnI)
endfor
?"阶乘位数:",int(nDigit)+1
clear
T1=seconds()
num=1000000
local azs[num]
lncnt=num-1
for lnI=2 to int(sqrt(num))
If azs[lnI]=.F.
for lnJ=lnI*lnI to num step lnI
* If azs[lnJ]!=.f.
azs[lnJ]=.T.
* lncnt=lncnt-1
* endif
endfor
endif
end...
Local lnI, drvName, drvType ,mydri
mydri=""
for lni=1 to 25
drvname=chr(64+lni)+": "
drvtype=drivetype(drvname)
do case
case drvtype = 1
driname="驱动器 " + drvname + "无类型"
case drvtype = 2
driname="驱动器 " + drvname + "是一个软盘驱动器"
case drvtype = 3
drin...
D1={^2012.12.08}
D2={^2013.11.25}
(Year(D2)-Year(D1))*12+MONTH(D2)-MONTH(D1)
sfzh="123456197801123456"
Ctod(Transform(Val(Substr(sfzh,7,8)),"9999-99-99"))
Clear
ldDate=Date()
lcStr="一,二,三,四,五,六,七,八,九,十,十一,十二,十三,十四,十五,十六,十七,十八,十九,二十,二十一,二十二,二十三,二十四,二十五,二十六,二十七,二十八,二十九,三十,三十一"
=Alines(Adate,Chrtran(lcStr,",",Chr(13)+Chr(10)))
* 年
?Chrtranc(Transform(Year(ldDate)),"0123456789","〇一二三四五六七八九")+"年"
* 月
?...
年月日 Transform(Val(Dtos(Date())),"9999年99月99日")
时分秒 Transform(Val(Chrtran(Time(),":","")),"99时99分99秒")
期末日期:Gomonth(Date(Year(Date()),Month(Date()),1),1)-1
当月天数:Day(Gomonth(Date(Year(Date()),Month(Date()),1),1)-1)
'星期'+SUBSTRC('一二三四五六日',Dow(Date(),2)*2-1,1)
Year(Date())-Year(DDate)+IIF(MONTH(Date())-MONTH(DDate)<0,-1,IIF(Day(Date())-Day(DDate)>=0,0,-1))
Clear
出生日期={^2014.01.01}
当前日期={^2014.11.22}
lnM=0
If Day(当前日期)>=Day(出生日期)
天数=Day(当前日期)-Day(出生日期)+1
Else
lnM=-1
天数=Gomonth(当前日期,1)-当前日期+Day(当前日期)-Day(出生日期)+1
EndIf
总月数=(Year(当前日期)-Year(出生日期))*12+(Month(当前日期)-Month(出生日期))+lnM
?"岁数:"+Padl(Int(总月数/12),2," ")+" 岁"
?"月数:"+...
Date(Year(Date()),12,31)-Date(Year(Date()),1,1)+1
Dow(Date(Year(Date()),Ceiling(Month(Date())/3)*3-2,1),2)
Date()-Dow(Date(),2)+1
Date()-Date(Year(Date()),1,1)+1