跪求VFP编程高手解答 高分~~~

作者&投稿:昌河 (若有异议请与网页底部的电邮联系)
跪求!!vfp编程题目解答~

第一个,
转小写
Thisform.text1.value=lower(Thisform.text1.value)
thisform.refresh
转大写
Thisform.text1.value=UPPER(Thisform.text1.value)
thisform.refresh

第二个
转换的按钮
Thisform.label4.caption=str(Thisform.text1.value*3600+Thisform.text2.value*60+Thisform.text3.value)
thisform.refresh

第三个
选三个的按钮
Thisform.label3.caption=str((Thisform.text2.value-Thisform.text1.value)*rand()+Thisform.text1.value)
Thisform.label4.caption=str((Thisform.text2.value-Thisform.text1.value)*rand()+Thisform.text1.value)
Thisform.label5.caption=str((Thisform.text2.value-Thisform.text1.value)*rand()+Thisform.text1.value)
thisform.refresh

我都已经制成表单了,你可以到这下载
http://tg2a11.mail.163.com/netfolder/servlet/nfapp/GetFile/%E7%AD%94%E6%A1%88.rar?sid=NAQMOoxwtQiDFnrGoqwwzxwKGpyjrCFw&mid=1tbinho1z0L+9lU8EgAAsP

我上机试过了,此题百分百正确!


clear
a=int(2+int(rand()*98))
input "请任意猜一个2到99的整数:" to x
do while ax
if x>a
?"猜大了,请往小数猜!"
input "请猜比"+str(x,2)+"小的整数:" to x
else
?"猜小了,请往大数猜!"
input "请猜比"+str(x,2)+"大的整数:" to x
endif
enddo
?"猜对了!此数是:",a
cancel

怎么又是这个题目呢,我给了答案了,不过是分别写出来的,你如果想放在同一个文件中,把每个答案的前面的clear去掉就行了
程序1
clear
?"1992-2020年中间的闰年有:"
for year=1992 to 2020
if year%4==0 and year%100!=0 or year%400==0
?year
endif
endfor

程序2
clear
s=0
for i=100 to 999
if i%11=0
if i%10=8 or i/10%10=8 or i/100=8
?i
s=s+1
endif
endif
endfor
?"三位数中总共有",s,"个能被11整除同时又含有8的数字"

程序3
clear
a="Long long ago,there was a war between the birds and the beats. No one knows what they fought about.The bat did not know whose side he should take. He thought and thought, "
c="then decided he must try to be on the side of the winners.So he watched from far away. After a while, it seemed that the birds were going to win.He flew over to join them"
b=""
i=1
for j=1 to len(a)
if substr(a,j,1)!=" "
b=b+substr(a,j,1)
endif
endfor
for j=1 to len(c)
if substr(c,j,1)!=" "
b=b+substr(c,j,1)
endif
endfor
?b

程序4
input "请输入数字:" to n
P=2*N-1
FOR I=1 TO P
IF I<=N
?SPACE(N-I+1)
FOR J=1 TO 2*I-1
??"*"
ENDFOR
ELSE
?SPACE(I-N+1)
FOR K=1 TO 2*(2*N-I)-1
??"*"
ENDFOR
ENDIF
ENDFOR

1、clear
for i=1992 to 2020
if mod(i,4)=0
?i
endif
endfor
2、clear
s=0
for i=100 to 999
if mod(i,11)=0.and."8"$alltrim(str(i))
??i
s=s+1
endif
endfor
?"次数为:",s
3、clear
t="Long long ago, there was a war between the birds and the beasts.No one knows what they fought about.The bat did not know whose side he should take.He thought and thought,"
t=t+" then decided he must try to be on the side of the winners.So he watched from far away. After a while, it seemed that the birds were going to win.He flew over to join them."
s=""
FOR i=1 TO LEN(t)
m=ALLTRIM(SUBSTR(t,i,1))
IF !EMPTY(m)
s=s+m
ENDIF
ENDFOR
?s
4、clear
input "请输入行数:" to n
FOR i=1 TO n
s=""
FOR j=1 TO 2*i-1
s=s+"*"
ENDFOR
s=SPACE(n-i)+s
?s
ENDFOR
FOR i=n-1 TO 1 STEP -1
t=""
FOR j=2*i-1 TO 1 STEP -1
t=t+"*"
ENDFOR
t=SPACE(n-i)+t
?t
ENDFOR