/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication56;

import java.util.Scanner;

/**
 *
 * @author joelx
 */
public class JavaApplication56 {

    /**
     * @param args the command line arguments
     */
    public static boolean estminicule(char c){
        return (c >='a' && c<='z');
        
    }
    public static char estmajuscule(char c){
        if (estminicule(c)) {
            return (char) ((int)c + (int) 'A' - (int) 'a');
        }
        return c;
    

        
    }
    
   
    public static boolean exclusifminus(String f){
        for(int k = 0; k<f.length();++k)
            if(!estminicule(f.charAt(k))){
                return false;
            }
        
            return true;
                
        
    }
     public static String majuscule(String s){
         String res = ""; 
          for(int k = 0; k<s.length();++k){
              res+=estmajuscule(s.charAt(k));
          }
          return res;
     }
     public static int nombreapp(String s,char c){
         int pos = 0;
          for(int k = 0; k<s.length();++k){
              char h = s.charAt(k);
              if(h == c){
                  ++pos;
              }
          }
          return pos;
         
         
     }
    public static String copierenverser(String f){
        String res ="";
        for(int k =f.length()-1; k>=0;--k){
            res +=f.charAt(k);
        }
        return res;
        
    }
     public static boolean Palindrome(String s){
        return copierenverser(s).compareTo(s) == 0;
    }
     
        
    //Solution plus efficace : n'utilise pas de mémoire temporaire
    //et ne parcours que la moitié de la chaine 's'
//    public static boolean estPalindrome(String s) {
//        int g = 0, d = s.length() - 1;
//        while (g < d && s.charAt(g) == s.charAt(d)) {
//            ++g;
//            --d;
//        }
//        return g >= d;
//    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("entrez un mot svp ");
        String joel = in.next();
        char jean = joel.charAt(2);
        System.out.println(Palindrome(joel));
//        if(exclusifminus(joel)){
//            System.out.println("ce String EST former exclusivement de majuscule");
//        }else{
//            System.out.println("ce String n'est pas  former exclusivement de majuscule");
//        }
//        System.out.println(estmajuscule(jean));
       
//        if(estminicule(jean)){
//            System.out.println(jean +" est minicule");
//        }else
//            System.out.print(jean +" n'est pas minicule");
        
        
        // TODO code application logic herez
    }
    
}
