SHARE
TWEET

Untitled

a guest Nov 17th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package task3;
  2. import java.util.Scanner;
  3. import java.util.Random;
  4. public class lasttask {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.         int num,num1,num2,num3,num4;
  9.         Scanner in=new Scanner(System.in);
  10.         Random rnd=new Random();
  11.        
  12.          num=rnd.nextInt(9000)+1000;
  13.          System.out.println(num);
  14.          num1=num/1000;
  15.          num2=(num/100)%10;
  16.          num3=(num/10)%10;
  17.          num4=num%10;
  18.          if ((num1==num4)&&(num2==num3))
  19.          {
  20.              System.out.println("the number is polidrom");
  21.          }
  22.          else
  23.          {
  24.              System.out.println("the number is not polidrom");
  25.          }
  26. }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top