Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

666666

Option Strict On
Module Module1

    Function simetry(ByVal x As Integer) As Boolean
        Dim y As Integer = 0
        Dim b As Boolean
        y = x Mod 10
        While x > 10
            x = x \ 10
        End While
        If y = x Then
            b = True
        End If
        Return b
    End Function

    Function middlenumber(ByVal x As Integer) As Integer
        Dim y As Integer = x
        Dim n As Integer = 0
        While y > 10
            y = y \ 10
            n = n + 1
        End While
        x = CInt((x - (x Mod 10)) / 10) - CInt(y * CInt(Math.Pow(10, n - 1)))
        Return x
    End Function
    
    Sub Main()

        Dim x As Integer = CInt(Console.ReadLine())
        Dim b As Boolean = simetry(x)
        While b = True
            x = middlenumber(x)
            If x < 10 Then Exit While
        End While

        If b = True Then
            Console.WriteLine("Yes")
        Else
            Console.WriteLine("No")
        End If

        Console.ReadKey()
    End Sub

End Module

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.