Challenge

This is a discussion on Challenge within the C++ Programming forums, part of the General Programming Boards category; Ok, I Just read the new challenge and some thing hit me hard(Excuse my corny literature) while trying to make ...

  1. #1
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203

    Exclamation Challenge

    Ok, I Just read the new challenge and some thing hit me hard(Excuse my corny literature) while trying to make sense of it(I didn't rack my brains; I directly went to the solutions page ) . See this output:
    Code:
    input:
    vector = {-1, -2, -4, -5, -6};
    output:
    0 //Should'nt it be returning the least naegative number???

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    what

  3. #3
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203

    Red face ...

    Quote Originally Posted by Brian
    what
    what?
    Idon't get you.
    [edit]
    oops...
    Please go to cprogramming.com or its 'challenges page'
    If thats what you mean by what
    Sorry I didn't make any sense.
    [/edit]
    Last edited by arjunajay; 08-19-2005 at 08:08 AM. Reason: ...

  4. #4
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by arjunajay
    what?
    Idon't get you.
    [edit]
    oops...
    Please go to cprogramming.com or its 'challenges page'
    If thats what you mean by what
    Sorry I didn't make any sense.
    [/edit]
    I like your sig

  5. #5
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203
    I like your sig
    You're kidding me >
    My tail is on fire, and you like my sig?

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    There are several challenges on the website, give us the URL to the specific one you are asking about.

  7. #7
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203

    Talking ...

    oops again...
    here it is...
    sub array problem
    Its the newest one...

  8. #8
    Registered User
    Join Date
    Nov 2001
    Posts
    255
    i dont get there solution either i can get it to work just dont get there method of going about it


    i had this:

    Code:
    double values[5];
    double max = 0;
    for(int i = 0;i <= values[i];i++)
    {
    cin >> values[i];
    if(values[i] > max)
    max = values[i];
    }
    cout << "MAX: " << max << endl;
    return 0;
    hooch

  9. #9
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203

    ...

    They are setting the sum to zero when ever they encounter a negative sum as far as I recall. I'm thinking of introducing another variable to store the least negative(or +ve) number ever enconutered to solve this.
    [edit]
    oh..oh..
    Your program finds the largest element not the sum...
    [/edit]
    Last edited by arjunajay; 08-20-2005 at 03:15 AM. Reason: nothing...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. AI Challenge
    By unknown_111 in forum General AI Programming
    Replies: 0
    Last Post: 10-02-2007, 01:18 AM
  2. A Challenge in C++
    By Brad0407 in forum C++ Programming
    Replies: 38
    Last Post: 07-18-2007, 01:56 PM
  3. Programming Challenge (for my school)
    By Ezerhorden in forum C++ Programming
    Replies: 2
    Last Post: 01-04-2006, 06:56 AM
  4. Challenge?
    By Mackology101 in forum C Programming
    Replies: 5
    Last Post: 11-23-2004, 02:30 PM
  5. Requesting a challenge
    By RealityFusion in forum C++ Programming
    Replies: 8
    Last Post: 08-18-2003, 09:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21