'生成三位正整数,它能被7整除,且十位数等于5
For i = 100 To 999
If i Mod 7 = 0 And Mid(Trim(Str(i)),2,1) = "5" Then Debug.Print (i)
Next
----
即时打印结果:
154
252
259
350
357
455
553
651
658
756
854
952
959
'生成三位正整数,它能被7整除,且十位数等于5
For i = 100 To 999
If i Mod 7 = 0 And Mid(Trim(Str(i)),2,1) = "5" Then Debug.Print (i)
Next
----
即时打印结果:
154
252
259
350
357
455
553
651
658
756
854
952
959