CaptainIT

so thuan nghich JAVA

Jul 15th, 2018
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package sothuannghich;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11. *
  12. * @author ASUS
  13. */
  14. public class Sothuannghich {
  15.  
  16. /**
  17. * @param args the command line arguments
  18. */
  19. public static void main(String[] args) {
  20. // TODO code application logic here
  21. int n;
  22. System.out.print("n=");
  23. n = new Scanner(System.in).nextInt();
  24. int m;
  25. m=n;
  26. int tong;
  27. tong=0;
  28. while(n>0){
  29. tong=(tong*10)+(n%10);
  30. n/=10;
  31. }
  32. if(tong==m){
  33. System.out.println("YES");
  34. }
  35. else System.out.println("NO");
  36. }
  37.  
  38. }
Add Comment
Please, Sign In to add comment