Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package asd;
  2.  
  3. public class Test {
  4.     public static void palindrome(Integer tmp)
  5.     {
  6.         StringBuffer sb= new StringBuffer(tmp.toString());
  7.         if(sb.toString().equals(sb.reverse().toString()))
  8.         {
  9.             System.out.println("Палиндром");
  10.         }
  11.         else
  12.             System.out.println("Не палиндром");
  13.     }
  14.     public static void palindrome(String str)
  15.     {
  16.         StringBuffer sb= new StringBuffer(str);
  17.         if(sb.toString().equals(sb.reverse().toString()))
  18.         {
  19.             System.out.println("Палиндром");
  20.         }
  21.         else
  22.             System.out.println("Не палиндром");
  23.     }
  24.     public static void main(String[] args) {
  25.         // TODO Auto-generated method stub
  26.         pol(545);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement