Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Dim MAX_DIF, MIN_DIF, X As Integer
- Sub Main()
- Console.WriteLine("<><><><><><><><><><><><><>")
- Console.WriteLine("")
- Console.WriteLine("_____ MINI PROJETO 11 _____")
- Console.WriteLine("")
- Console.WriteLine("<><><><><><><><><><><><><>")
- Console.WriteLine("")
- MAX_DIF = 0
- MIN_DIF = 100
- Dim K(10) As Integer
- For i = 1 To 10
- Console.Write("Digite o valor para K " & i & ": ")
- K(i) = Console.ReadLine()
- Next
- For i = 2 To 10
- X = Math.Abs(K(i) - K(i - 1))
- If X > MAX_DIF Then
- MAX_DIF = X
- End If
- If X < MIN_DIF Then
- MIN_DIF = X
- End If
- Next
- Console.WriteLine("")
- Console.WriteLine("A diferença máxima é: " & MAX_DIF)
- Console.WriteLine("")
- Console.WriteLine("A diferença mínima é: " & MIN_DIF)
- Console.ReadKey()
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement