Advertisement
Guest User

Untitled

a guest
May 14th, 2014
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class SymmetricNumbersInRange {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         int a = input.nextInt();
  9.         int b = input.nextInt();
  10.         for(int i = a;i<=b;i++){
  11.             if(i<=11){
  12.                 System.out.print(i+" ");
  13.             }
  14.             else if(i>11 && i<100){
  15.                 if(i%10==i/10){
  16.                     System.out.print(i+" ");
  17.                 }
  18.                
  19.             }
  20.             else if(i>=100){
  21.                     if(i%10==i/100){
  22.                         System.out.print(i+" ");
  23.                     }
  24.             }
  25.         }
  26.         System.out.println();
  27.  
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement