Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class test
- {
- static Scanner reader = new Scanner (System.in);
- /**
- * @param args
- */
- public static void main(String[] args)
- {
- System.out.println("enter the num");
- int num = reader.nextInt();
- if (num <= 999){
- int meot = num/100;
- int asarot = (num/10)%10;
- int yehidot = num%10;
- if (yehidot == meot)
- {
- System.out.println ("The num is palindrom");
- }
- if (meot != yehidot)
- {
- System.out.println ("The num isn't palindrom");
- }
- System.out.println(meot + asarot+ yehidot );
- System.out.println ( meot*100 + asarot*10 +yehidot);
- if (num%33 == 0)
- {
- System.out.println ("sherit 33");
- }
- if (num%33 != 0)
- {
- System.out.println (" lo sherit 33");
- }
- if (num%3 == 0)
- {
- System.out.println ("mithalek be 3");
- }
- if (num%3 != 0)
- {
- System.out.println (" lo mithalek be 3");
- }
- if (num>0)
- {
- System.out.println (num);
- }
- if (num <= 0)
- {
- System.out.println (num*-1);
- }
- }
- if (9999 >= num && num >1000){
- int alpiot = (num/1000);
- int meot = ((num/100)%10);
- int asarot = ((num/10)%10);
- int yehidot = num%10;
- if (yehidot == alpiot && asarot == meot )
- {
- System.out.println ("The num is palindrom");
- }
- if (yehidot != alpiot)
- {
- System.out.println ("The num isn't palindrom");
- }
- System.out.println(alpiot + meot+ asarot +yehidot );
- System.out.println ( alpiot + asarot*10 +asarot*100 +yehidot*1000);
- if (num%33 == 0)
- {
- System.out.println ("sherit 33");
- }
- if (num%33 != 0)
- {
- System.out.println (" lo sherit 33");
- }
- if (num%3 == 0)
- {
- System.out.println ("mithalek be 3");
- }
- if (num%3 != 0)
- {
- System.out.println (" lo mithalek be 3");
- }
- if (num>0)
- {
- System.out.println (num);
- }
- if (num <= 0)
- {
- System.out.println (num*-1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment