frogboy77 73 Posting Pro in Training

1 see edit.
2 str.length() will give you the length of the string called str. You have no such string.
3. google.

frogboy77 73 Posting Pro in Training

1 Where are your #includes and namespace?
2 What is str.length (why would that give you the size of k)?
3 Where is your output line?
EDIT If this is a snippet ignore 1, if not you need to check your braces and there is no return statement.

frogboy77 73 Posting Pro in Training

You're in over your head. Get a book and start reading. :)

frogboy77 73 Posting Pro in Training

I a still confused, maybe I am looking too much into it, but I am so lost. Please someone help me.

No what you mean to say is "Please someone do it for me."

Much more precise. (see i have already helped)

frogboy77 73 Posting Pro in Training

As bad as these guys?

frogboy77 73 Posting Pro in Training

Well it is difficult to kill 127 of one's schoolmates without one. DUH.

sergent commented: lol +0
frogboy77 73 Posting Pro in Training

It is repeating the loop. Try a couple of cout lines to find out where you're going wrong(ie right before line 21).

frogboy77 73 Posting Pro in Training

The world has lost a salesman (admittedly a good one).

frogboy77 73 Posting Pro in Training

So the intellectually superior take from the desperate and intellectually inferior. Is this not evolution in action.

frogboy77 73 Posting Pro in Training

It sounds to me like a compound interest question, hence my answer.

frogboy77 73 Posting Pro in Training

691200

frogboy77 73 Posting Pro in Training

I doubt she's going to do everything for you. Unless she's in a really really really good mood.

frogboy77 73 Posting Pro in Training

I'm not sure with only partial code but on line 10 do you want to be incrementing j before the output on line 11?

frogboy77 73 Posting Pro in Training

you could try

srand(time(NULL));

worked in the past for me but hey i'm not good at this so "pinch of salt".

frogboy77 73 Posting Pro in Training

line 3 remove the .h

line 38 remove the void

frogboy77 73 Posting Pro in Training

Apathy will surely damn us.

Then we are damned!

frogboy77 73 Posting Pro in Training

I'll be back in a decade.

frogboy77 73 Posting Pro in Training

Rome fell, but not overnight.

But it did fall. The question is where is the point of no return?

frogboy77 73 Posting Pro in Training

I didn't realise there was an age limit. Could you let me know what it is. I'm 3 years old by the way.

frogboy77 73 Posting Pro in Training

I don't do graphics. My expertise is in back-end development.

Like this?

frogboy77 73 Posting Pro in Training

works fine for me with the mentioned changes

frogboy77 73 Posting Pro in Training

you need to loop through the array and find the largest number and also store which person this is attributed to. So have a max variable and a whichperson variable and update them when a larger value is found. set max to -1 to begin with.

frogboy77 73 Posting Pro in Training

you are replacing tmp every time you compare 2 values.

ie on the very last check if person[9]>person[8](or nine in this case, checking against itself) you replace the value. this doesn't mean it was the biggest of all. one loop should be sufficient for this task.

frogboy77 73 Posting Pro in Training

This isn't the end of the world even as we know it. Shit happens, outbreaks like that occur frequently all over the world and the world hasn't ended yet, neither has society.

Bet the Romans said that.

frogboy77 73 Posting Pro in Training

I doubt anyone will help you without some sign you have attempted the problem yourself. Even if someone were so charitable (i.e stupid) your description of the problem is a little vague.
Go away make an effort and come back with a specific problem.

frogboy77 73 Posting Pro in Training

English rioting for no apparent political reason, more a case of get what you can while the going is good.

Does it get much worse than this?

Is society really broken?

frogboy77 73 Posting Pro in Training

That's good its the equivalent of $10.23 here.

frogboy77 73 Posting Pro in Training
frogboy77 73 Posting Pro in Training

By the way, it's math, not maths.

NO it is not.

frogboy77 73 Posting Pro in Training

At what point does conciseness become more important than readability, or vice-versa (given that there is no difference in performance)?

Is there an element of snobbery amongst programmers to certain techniques or are certain things just purely bad practice?

frogboy77 73 Posting Pro in Training

In line 23 if I enter 100+99 why would the second character in the string be an operator?

Line 25 in the second i believe chars are compared with '' not ""

edit: that's single not double quotes

(though i think this project may be flawed at the planning stage)

frogboy77 73 Posting Pro in Training

Dragon Age: Origins, or Prototype depending on your taste.

frogboy77 73 Posting Pro in Training

42% of Brits have not sent a snail mail letter in the last six month

that would have been true for me before email

51% of British workers would rather send an email than pick up the phone to a colleague, whereas only 24% would do the rather do the reverse

its easier to say something someone would not like to hear (i.e yesterdays report was awful) by email than to say it directly to them (cowardly too). How many people have been dumped by email.

25% of Brits don't want their boss seeing the email they have been sending at work, and 11% have flirted with 'someone they should not have' by email

that's because they're mostly not work related and show how much spare time they have actually got (not what your boss wants to hear). Why not send your naughty emails in your own time?

frogboy77 73 Posting Pro in Training

@sergent
RUN FOR THE HILLS!

frogboy77 73 Posting Pro in Training

That doesn't negate the point.

frogboy77 73 Posting Pro in Training

Man up, when you're dead you're dead. Accept it. It will be lonely, it will be unpleasant, but it will happen. Take solace in the fact that you affected at least one other human being in a positive way. If you didn't, at this point it makes no real difference so don't worry about that either.
If i'm wrong (just possible), then if this is the system designed by a guy whom i am in the image of, then i really can do nothing he wouldn't do, therefor i qualify automatically.
I win.

Portgas D. Ace commented: Spot on +0
frogboy77 73 Posting Pro in Training

Thanks for the help (particularly Vernon, i think i should have made the variables const, and i wanted to play around with them so didn't want to retype all values into the function again so made them global). If anyone is interested here's the whole problem.
I know it can't be done by brute force but i wanted to get the idea behind the formula.

frogboy77 73 Posting Pro in Training

I would consider making 2201 posts in 2 months an obsession or something more malicious. (i.e spammer or very lonely person)

jingda commented: Good guess but wrong +0
frogboy77 73 Posting Pro in Training

Ok then using your "common sense" what is the answer if n=2000? Without the program.
"Simple" is relative. I also know how to write an output line.

frogboy77 73 Posting Pro in Training

I wrote this test code trying to work out a problem. The code gives the correct answer for the example (zero) but to understand the problem i need to understand what the code is doing on a sort of step by step basis. In other words how to do it with a pen and paper.
The answer is 3240 i just don't know why. Can anyone help?

#include <iostream>

using namespace std;

int fun(int n);
int a=50;
int b=2000;
int c=40;


int main()
{
    cout<<fun(0)<<endl;

    return 0;
}

int fun(int n)
{
    if(n>b) return n-c;
    if(n<=b) return fun(a+fun(a+fun(a+fun(a+n))));
}
frogboy77 73 Posting Pro in Training

I think i prefer atheism on the basis that spending eternity in hell sounds pretty bad but spending eternity in a place with all the "good" people sound like the christmas day with the family ad infinitum.:scared:

frogboy77 73 Posting Pro in Training

AD are you really DA (Dick Armey)?

frogboy77 73 Posting Pro in Training

A good motto

"I'm paranoid, but am i paranoid enough?"

frogboy77 73 Posting Pro in Training

@Old Lizard
Isn't it difficult to be smug about a society that thinks more of its population are criminals than any other (including dictatorships)?

frogboy77 73 Posting Pro in Training

I raised a similar topic some years ago with a mature(as in age) computer science student near the end of his studies. His reply to people being in similar wages for different jobs was that he had studied hard to get to where he was so when he finished he deserved a better wage. This point may have had some substance were we not (at the time) living in a country where secondary education was funded by the taxpayer. In effect the people who he thought he should earn more than funded the education which gave him that belief.:-O

frogboy77 73 Posting Pro in Training

The problem is the poor(including myself) don't have the will and drive of the rich, otherwise we'd have taken all they've got by now.

frogboy77 73 Posting Pro in Training

The search for his Mac or listening to him tell you about it?

Nick Evan commented: :) +0
frogboy77 73 Posting Pro in Training

simple gcd

int g_c_d(int a,int b)
{
    if(b==0){return a;}
    else{return g_c_d(b,a%b);}
}
frogboy77 73 Posting Pro in Training

I watched every second. I am never prouder than the occasions where i partly finance an event for people i don't know or will probably ever meet. Proud to be British.

Nick Evan commented: Haha +0
frogboy77 73 Posting Pro in Training

so how many different shopping lists did the wife get done?