This is the problem
You are walking along on a nice sunny day and stumble upon a very odd bag of beans. This bag contains a few black beans and a few white beans. You want to use the bag, but you don't have a use for the beans. Therefore, you decide to take all the beans out. Being an odd bag, you discover only two beans can be removed at a time. Furthermore, the following rules apply:
If both the beans you remove are the same color, one more black bean magically appears in the bag.
If the beans you remove differ in color, one more white bean magically appears in the bag.
Since you are a curious computer science student, you decide to write a program. This program will input the number of black beans and the number of white beans in the bag. The output of this program will be the color of the last bean in the bag.
this is what I have so far
my problem is that none of the numbers go to zero
int blk, white, ran, ran1;
cout<<"How many black beans ";
cout<<"How many white bean ";
if (ran == ran1)
blk += 1;
if (ran != ran1)
white += 1;
if (ran = 1)
if (ran = 2)
}while (blk == 0 || white == 0);
cout<<"Black : "<<blk<<" White : "<<white<<endl;