vb求回文数的算法
答案:2 悬赏:30 手机版
解决时间 2021-01-01 19:41
- 提问者网友:两耳就是菩提
- 2021-01-01 16:49
vb求回文数的算法
最佳答案
- 五星知识达人网友:蓝房子
- 2021-01-01 18:26
Private Sub Command1_Click() '回文数
For i = 100 To 200
ge = i Mod 10
shi = i \ 10 Mod 10
bai = i \ 100
If ge = bai Then
Print i,
geshu = geshu + 1
If geshu Mod 9 = 0 Then Print
End If
Next i
Print
Print
Print "geshu="; geshu
End Sub
For i = 100 To 200
ge = i Mod 10
shi = i \ 10 Mod 10
bai = i \ 100
If ge = bai Then
Print i,
geshu = geshu + 1
If geshu Mod 9 = 0 Then Print
End If
Next i
Print "geshu="; geshu
End Sub
全部回答
- 1楼网友:行雁书
- 2021-01-01 18:59
private sub form_click() dim a as string a = inputbox("请输入一串数字,判断是否是回文:") print huiwen(a) end sub function huiwen(b as string) as string if b = strreverse(b) then huiwen = "是回文" else huiwen = "不是回文" end if end function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯