當前位置:編程學習大全網 - 電腦編程 - vb編程 判斷壹個整數是否是對稱數

vb編程 判斷壹個整數是否是對稱數

dim a as string

a=right(str(i),len(str(i))-1) '也可以直接輸入字符串

dim f as boolean

dim i as integer

f=true

for i=1 to len(a)\2

if mid(a,i,1)<>mid(a,len(a)-i+1,1) then f=false

next i

if f=true then msgbox "Yes" else msgbox "No"

  • 上一篇:中科億海微電子研究院有限公司怎麽樣
  • 下一篇:C語言中求N個數據的的和
  • copyright 2024編程學習大全網