VB輸出位數問題,VB輸出位數問題

2022-10-08 05:46:25 字數 592 閱讀 6033

1樓:匿名使用者

private sub command1_click()cls

for i = 1 to 20

randomize

x = int(rnd * 101)

print format(x, " 00");

if i mod 5 = 0 then printnext i

end sub

***************=

private sub command1_click()clsfor i = 1 to 20

randomize

x = str(int(rnd * 101))x = x + space$(5 - len(x))print x;

if i mod 5 = 0 then printnext i

end sub

2樓:匿名使用者

dim i as long

dim s as string

i = 80

s = cstr(i)

s = s + space$(5 - len(s))這樣不足五位的由空格補齊,前面沒有符號位

設計VB應用程式求解問題 輸出上的素數個數

求素數的方法百 用2 m 1中所有數去度除m,能除知盡就不是素數,道反之則是素數。版 private sub command1 click dim i as integer,m as integer,tag as booleanfor m 2 to 100tag truefor i 2 to m 1...

如何用VB程式設計輸出字母金字塔

用空bai格來顯示不是字母的du,然後zhi按變數dao顯示對應的數量的字版母即可。權private sub mand1 click dim i as integer dim j as integer dim n as integer n 7 for i 1 to n print space n i...

vb怎樣才能讓Print輸出是在Text1裡邊

不用 print 的!設定 text 控制元件 的 multiline true 多行文字框 scrollbars 2 垂直滾動條 然後 用 text1.text text1.text 新增的內容 vbcrlf vbcrlf 是 回車換行 符號 常數 祝你順利 先在屬性設定視窗將text1的mult...