Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package asd;
- public class Test {
- public static void palindrome(Integer tmp)
- {
- StringBuffer sb= new StringBuffer(tmp.toString());
- if(sb.toString().equals(sb.reverse().toString()))
- {
- System.out.println("Палиндром");
- }
- else
- System.out.println("Не палиндром");
- }
- public static void palindrome(String str)
- {
- StringBuffer sb= new StringBuffer(str);
- if(sb.toString().equals(sb.reverse().toString()))
- {
- System.out.println("Палиндром");
- }
- else
- System.out.println("Не палиндром");
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- pol(545);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement