1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub chiffre_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chiffre.TextChanged
Dim tabl(500, 500) As Double
Dim i As Decimal
Dim j As Integer
i = chiffre.Text
For i = 0 To CType(chiffre.Text, Integer)
tabl(i, 0) = i
tabl(0, i) = i
Next
For i = 0 To CType(chiffre.Text, Integer)
For j = 1 To i
tabl(i, j) = tabl(i, j - 1) + tabl(i - 1, j)
tabl(j, i) = tabl(i, j - 1) + tabl(i - 1, j)
Next
Next
Response.Write("<table border=1 cellspacing=2>")
For i = 0 To CType(chiffre.Text, Integer)
Response.Write("<tr ALIGN=right VALIGN=middle>")
For j = 0 To CType(chiffre.Text, Integer)
Response.Write("<td ALIGN=right VALIGN=middle>" & tabl(i, j) & "</td>")
Next
Response.Write("</tr>")
Next
Response.Write("</table>")
End Sub
Protected Sub okButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles okButton.Click
End Sub
End Class |
Partager