View Single Post
  #1  
Old 12-09-2009, 12:02 PM
aNt
underworldlive | tomato
 
Join Date: Jul 2005
Location: london
Posts: 160
Re: Underworldlive version 3.0 thread
Code:
public static void main(String[] args) {
    System.out.print("splash me a number: ");
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int x, y, c = 0;
    for( x = 2; x < n ; x++ ) {
          if( x % 2 != 0 || x == 2 ) {
               for( y = 2; y x / 2 ) {
                  System.out.println( x );
                  c++;
               }
          }
     }
     System.out.println( "\n total: " + c );
}
Is the slacker way i'd do it