Albee 發問時間: 電腦與網際網路程式設計 · 1 0 年前

VB程式上的問題,請各位高手幫幫忙

最後十題>\"<

拜託幫幫忙

這些問題丟掉程式裡頭跑大多都跑的出答案

但是我家電腦重灌之後就沒裝VB了

根本沒辦法跑><

所以要請各位幫幫忙

這是我期末考的題目,考完了

現在要用到答案>\"<

沒程式根本跑不出來,用算了...饒了我吧= =\"

31. 執行下列後結果為? ___________

A = 1:B = 2:C = 3

IF B > 1 THEN

 IF A < 1 THEN

  C = 2

 ELSE

  C = 4

 END IF

END IF

32.希望在表單上印出下列數字,

應在空格處填入_______________________

1000

0100

0010

0001

For i = 1 To 4

 For j = 1 To 4

If____________Then Print \" 1 \"

Else Print \" 0 \"

  Next j

Print

Next i

33.下列程式的執行結果為 ___________

X=1 ; A=0 ; B=0 ; C=0

Do While X <=20

Select Case X Mod 5

Case 0

A = A + 1

Case 1 To 3

B = B + 1

Case Else

C = C + 1

End Select

X = X + 1

Loop

Print B

34.下列程式的結果為何?______________

N = 0 : I = 0

While I < 50

 If I Mod 13 = 1 Then

  N = N + I

 End If

 I = I + 3

Wend

Print \" N = \" ; N

35.執行下列程式結果為何?________________

 S = 0 :  X = 20

 FOR X = 1 TO 5

  S = S + X

 NEXT X

 PRINT X

36.執行下列片段, K值為何?_____________

K= 0

For I = 1 to 5

 For J = I + 2 to 4

  K = K + 1

 Next J

 K = K - 1

Next I

Print K

37.執行下列程式後,結果為______________

I = 16 : K = 0

Do While I > 10

For J = 1 To I

K = K + J Mod 5

Next J

I = I - 3

Loop

Print K

38.下面程式,執行後結果為何?_____________

C = 0

FOR K = 1 to 5

 FOR J = K to 5

  C = C + 1

 NEXT J

NEXT K

PRINT C

39.a = 15: b = 27

x = a : y = b

Do Until a = b

 If a > b Then a = a - b

 If a < b Then b = b - a

Loop

Print ( x / a ) ; \" / \" ; ( y / a )

上述程式之執行結果會印出__________________

40.執行下面程式後,結果為何?________________

DIM A( 3 )

SUM = 0

FOR I = 1 to 3

 SUM = SUM + I

 A( I ) = SUM

NEXT I

PRINT A( 3 )

1 個解答

評分
  • 世賢
    Lv 7
    1 0 年前
    最佳解答

    31.

     a=1

     b=2

     c=4

    32.

     i = j

    33.

     x=21

     a=4

     b=12

     c=4

    34.

     N = 27

    35.

     S = 15

     X = 6

    36.

     k = -2

    37.

     i = 10

     j = 14

     k = 57

    38.

     15

    39.

     5 / 9

    40.

     6

    2006-01-19 16:24:01 補充:

    第 32 題應該寫為:If i = j Then Print " 1 "; Else: Print " 0 ";

    • Commenter avatar登入以對解答發表意見
還有問題?馬上發問,尋求解答。