Results 1 to 5 of 5

Thread: How would you do this.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    This is post at www.cprogramming.com and noone seemed to get it. I was just curious if any of you could write down code that could do this.

    {
    It seems as if no one out their can help me, but I think it may be my fault for not explaining this program clearly. So I will take one more shot at this. Here goes!
    what I need is this: (I already have the right side, I just need help on getting the left side). Thanks.
    The exact post is http://www.cprogramming.com/cgi-bin/...age=0&Session=

    a
    ab
    abc
    abcd
    abcde
    abcdef
    abcdefg
    abcdefgh
    ihgfedcbabcdefghi
    jihgfedcbabcdefghij
    kjihgfedcbabcdefghijk
    etc,etc...}

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    First of all my experience with that board has been bad. I think there is like 5 people that have any IQ on that board. Anyway......

    Your link is broke, so I have no idea what your question is. Can you fix the link, or retry your question.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    hmm, link works fine for me.

    I would have to agree, my experience there has also been bad.

  4. #4
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Yeah the link worked this time, but I still dont understand what your question is.
    Are you trying to get a print out lined up like that?
    Are you trying to get letters like that?
    I dont understand what you are after
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  5. #5
    Addicted Member
    Join Date
    Jan 2001
    Location
    Little Rock, Ar
    Posts
    151
    This what you mean?
    Code:
    #include <iostream.h>
    
    void main()
    {
    	int l; // letter
    	int n; // letter to count to
    
    	for(n = 1; n <= 26; n++)
    	{
    		// set l to the current letter
    		for(l = n; l >= 1; l--)
    		{
    			cout << (char)(96 + l);
    		}
    		// now start from a to n
    		for(l = 1; l <= n; l++)
    		{
    			if((96 + l) != 97)// don't repeat a
    				cout << (char)(96 + l);
    		}
    		cout << endl;
    		l = 1;
    	}
    	cout << endl;
    }
    
    // output
    /*
    dcbabcd
    edcbabcde
    fedcbabcdef
    gfedcbabcdefg
    hgfedcbabcdefgh
    ihgfedcbabcdefghi
    jihgfedcbabcdefghij
    kjihgfedcbabcdefghijk
    lkjihgfedcbabcdefghijkl
    mlkjihgfedcbabcdefghijklm
    nmlkjihgfedcbabcdefghijklmn
    onmlkjihgfedcbabcdefghijklmno
    ponmlkjihgfedcbabcdefghijklmnop
    qponmlkjihgfedcbabcdefghijklmnopq
    rqponmlkjihgfedcbabcdefghijklmnopqr
    srqponmlkjihgfedcbabcdefghijklmnopqrs
    tsrqponmlkjihgfedcbabcdefghijklmnopqrst
    utsrqponmlkjihgfedcbabcdefghijklmnopqrstu
    vutsrqponmlkjihgfedcbabcdefghijklmnopqrstuv
    wvutsrqponmlkjihgfedcbabcdefghijklmnopqrstuvw
    xwvutsrqponmlkjihgfedcbabcdefghijklmnopqrstuvwx
    yxwvutsrqponmlkjihgfedcbabcdefghijklmnopqrstuvwxy
    zyxwvutsrqponmlkjihgfedcbabcdefghijklmnopqrstuvwxyz
    
    Press any key to continue
    
    */

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