http://home.pchome.com.tw/girl/pooh01225/515.JPG
題目的執行檔在圖片這...
我知道直接要答案很不好..
可是當初並沒光碟安裝
安裝過vb.net的人都知道並不是很容易~至少對一個剛接觸電腦的女生而言.
所以等到安裝好就期未了~包括借光碟...
希望有人可以完整的告訴我答案~
謝謝~
2005-06-15 04:45:25 · 3 個解答 · 發問者 Anonymous in 電腦與網際網路 ➔ 程式設計
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form 設計工具產生的程式碼 "
----------中略--------------
#End Region
'把 Textbox1 的屬性 Multiline 設成 True
'拉一個 Textbox ㄧ個 Button
'Button的屬性 Text 把它改成 [ 字首轉大寫 ]
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim S, T As String
Dim i, SL, flag As Integer
S = TextBox1.Text
SL = Len(S) '計算字串長度
flag = 1
T = ""
For i = 1 To SL
If flag = 1 Then
T = T + UCase(Mid(S, i, 1)) '句首轉大寫
flag = 0
ElseIf flag = 0 And Mid(S, i, 1) = " " Then '當抓到空白時把旗標改成1,也就是說下ㄧ個字就是句首
T = T + Mid(S, i, 1) 'Mid 從字串S中第i個字抓1個字
flag = 1
ElseIf flag = 0 Then
T = T + Mid(S, i, 1) '逐字加入字串
End If
Next
TextBox1.Text = T
End Sub
End Class
----------------第一個:句首轉大寫-----------------
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form 設計工具產生的程式碼 "
-----------中略-----------
#End Region
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim S, i, j As Integer
Dim T As String
S = Val(TextBox1.Text)
TextBox2.Text = "" '清除畫面
For i = 1 To S
T = ""
If S - i > 0 Then
For j = S - 1 To i Step -1
T = T + " " '加空白,空白自己調整
Next
End If
For j = 1 To (i * 2 - 1)
T = T + Str((j Mod 10)) '加數字,第四題只要把要+的換成a即可
Next
TextBox2.Text = TextBox2.Text & T & vbNewLine '印字加換行
Next
End Sub
'拉一個 Button 兩個 Textbox
'兩個Textbox的Text內容清空
'把第二個 Textbox 的屬性 MultiLine 設為 True
End Class
------第二個: 數字金字塔-----------
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form 設計工具產生的程式碼 "
-------中略--------
#End Region
'拉一個 Button 兩個 Textbox
'兩個Textbox的Text內容清空
'把第二個 Textbox 的屬性 MultiLine 設為 True
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim S, i, j, A(11), B(11) As Integer
Dim T As String
S = Int(Val(TextBox1.Text))
A(0) = 1
A(1) = 1
TextBox2.Text = ""
For i = 1 To S
T = ""
For j = 1 To S - i
T = T & " " '空白自己調
Next
For j = 0 To i
If j = 0 Then
B(j) = A(j)
End If
If j > 0 Then
B(j) = A(j - 1) + A(j)
End If
If j = i Then
B(j + 1) = A(j)
End If
Next
For j = 0 To i
T = T & Str(A(j))
Next
TextBox2.Text = TextBox2.Text & T & vbNewLine
For j = 0 To i + 1
A(j) = B(j)
Next
Next
End Sub
End Class
--------第三個: 巴斯卡三角形數字----------Sorry,想太久....
2005-06-22 06:36:25 · answer #1 · answered by Anonymous · 0⤊ 0⤋
如果可以的話~我願意試試看~然後在自己修改~這樣也可順便學習
2005-06-19 10:10:02 · answer #2 · answered by Anonymous · 0⤊ 0⤋
一定要用.net嗎??vb行嗎??基本上程式碼部份差不多,要不要試試呢??
2005-06-16 08:23:28 · answer #3 · answered by 上官 5 · 0⤊ 0⤋