I'm writing a program that analyzes winnings and losses for a combination of wagers (x2 round robin) and need to write a loop that determines the earnings if a certain team loses. I've gotten started but I am getting answers that don't make sense. I tried tracing the loop and still don't see where I'm going wrong.
Here it is:
1 2 3 4 5 6 7 8 9 10
for (int j=1; j<(num-1); j++)
{
for (int i=(j+1); i<num; i++)
{
wins = wins + bet[j][i];//something here is wrong!
}
}
total = losses - wins;
cout << "If " << team[0] << " loses, you lose " << total << ".\n";
Here is my whole code so far if it is more helpful:
That seems to be the problem, thanks. And I don't start that loop from 0 because I don't want to include the j=0 elements of the array in winnings when team[0] loses.