Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public class Question1 {
  2.     public static void main(String[] args) {
  3.         for (int i = 102; i < 1000; ++i){
  4.             String x = "" + i;
  5.             if (x.contains("1")){
  6.                 if (!x.contains("11") && !(x.charAt(0) == '1' && x.charAt(2) == '1'))
  7.                 System.out.println(i);
  8.             }
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement