1. increasing prob with randoms

Hi, I need to be pointed towards the correct way to express,
a greater percent chance of something happending.
For example:

a and b are playing cards and a has a 60% chance of winning.
and the wins are generated by rand.(got that part) it's just
the percentages
Thanks
Michele

2. One easy way is to generate random numbers from 1-100. Anything from 1-60 inclusive would mean a wins, and anything else means b wins.

3. The random number will always be random, so you need to make the condition like what Cshot said...

4. i neeed something
a little more specific
i thought i could do something like this:

Code:
```#include<iostream>
#include<cstdlib>
#include<ctime>
#include<iomanip>
#include<iostream>
#include<fstream>
using namespace std;

//function prototype
int pp (int);
int score = 0;

void main()
{

ofstream outfile("A:\\0F1017_6_2.txt");
if(!outfile){
cerr << "Cannot open output file" << endl;

}

srand((unsigned) time(0));
int a = 0(.56);
int b = 0(.44);
int aa = 0;
int bb = 0;```
where i assigned the percentages to a and b.
it seems to work....
what do you think?
michele