Module Module1 Dim i As Integer Dim j As Integer Dim k As Integer = Console.ReadLine() Dim m As Integer = Console.ReadLine() Dim d(10) As Integer Dim c(20) As Integer Dim t As Integer = 0 Dim a() As Integer = {228, 48, 15, 111, 62} Dim b As Integer Dim result As Integer Public Function Mult(ByVal t As Integer, ByVal tempa As Integer) As Integer Dim Log(255) As Integer Dim Alog(255) As Integer ' Dim a As Integer Dim b As Integer = t Log(0) = -255 Alog(0) = 1 For i As Integer = 1 To 255 Alog(i) = Alog(i - 1) * 2 If (Alog(i) >= 256) Then Alog(i) = Alog(i) Xor 301 Log(Alog(i)) = i Next result = Alog((Log(tempa) + Log(b)) Mod 255) Return result End Function Sub Main() For i As Integer = 0 To m - 1 d(i) = Console.ReadLine() Next i For i As Integer = 1 To 10 c(i) = 0 Next i For i As Integer = 0 To m - 1 t = (d(i) Xor c(k - 1)) For j As Integer = k - 1 To 0 Step -1 If t = 0 Then c(j) = 0 Else c(j) = Mult(t, a(j)) End If If j > 0 Then c(j) = c(j - 1) Xor c(j) Next Next For i As Integer = 0 To k - 1 Console.WriteLine(c(i)) Next End Sub End Module
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)