1 solutions

  • 0
    @ 2025-3-3 16:28:34

    C :

    #include<stdio.h>
    int main()
    {
        int m,n,t;
        scanf("%d",&m);
        n=m/100;
        t=m%10;
        if(n==t)
            printf("Y");
        else
            printf("N");
        return 0;
    }
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
        int n,g,b;
        cin>>n;
        b = n / 100;
        g = n % 10;
        if(b == g){
        	cout<<"Y";
    	}else{
    		cout<<"N";
    	}
    }
     
    
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner sc = new Scanner(System.in);
    		int n = sc.nextInt();
    		int g = n % 10;
    		int b = n / 100;
    		if(g == b){
    			System.out.println("Y");
    		}else{
    			System.out.println("N");
    		}
    	}
    
    }
    

    Python :

    n = int(input())
    b = n // 100 % 10
    s = n // 10 % 10
    g = n // 1 % 10
    if b == g:
        print('Y')
    else:
        print('N')
    
    
    • 1

    Information

    ID
    10196
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By