Microsoft Small Basic

Program Listing:
Embed this in your website
TextWindow.WriteLine("entre com a sequencia de numeros. quando quiser encerrar digite P.")
index = 1
number = ""
While numbers[index -1] <> "P"
  numbers[index] = TextWindow.Read()
  index = index + 1
EndWhile

initIndex = 1
endIndex = Array.GetItemCount(numbers) - 1

equals = 1
while initIndex <> endIndex
  If numbers[initIndex] <> numbers[endIndex] Then
    equals = 0
    initIndex = endIndex
  Else
    initIndex = initIndex + 1
    endIndex = endIndex - 1
  EndIf
EndWhile

If equals = 1 Then
  reversalText = "pode"
Else
  reversalText = "nao pode"
EndIf

TextWindow.WriteLine("A sequencia " + reversalText +  " ser invertida")
Copyright (c) Microsoft Corporation. All rights reserved.