Results 1 to 2 of 2

Thread: ski jump pattern

  1. #1

    Thread Starter
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    ski jump pattern

    Hi, i was wondering if anyone could give me some advice on how to print something like this

    #
    ##
    ###
    ####
    #####
    ######
    #######

    I need to use a while statement. Any help is appreciated thanks
    Matt

  2. #2
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180
    This should do it.

    Code:
    public static void main ( String args[] ) {
    	
             int i = 0;
             String S = "";
    		
             while ( i < 7 ) {
    			
                      S += "#";
                      System.out.println ( S );
                      i ++;
    			
             }
    		
    }
    Simple enough. Hope that helps
    "'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width