|
From: Meyer v. L. <von...@ho...> - 2004-09-11 15:02:04
|
hi please take a look at the source:
#include <ctime>
#include <iostream>
using namespace std;
int main()
{
char buffer[3];
int i,r,temp;
int nums[50];
for(i = 1; i < 50; i++)
{
r = (rand() % 49) + 1;
temp = nums[i]; nums[i] = nums[r] = temp;
}
cout << "Your six lucky numbers are...\n";
cout << itoa(nums[1], buffer, 10) << " ";
cout << itoa(nums[2], buffer, 10) << " ";
cout << itoa(nums[3], buffer, 10) << " ";
cout << itoa(nums[4], buffer, 10) << " ";
cout << itoa(nums[5], buffer, 10) << " ";
cout << itoa(nums[6], buffer, 10) << " ";
cout << endl;
return 0;
}
i cant run without that win2k pro automaticly closes the apllication after i
ran it - what kind of code should i inserted therefore i take a look first
at the code before it closes it!?
btw the prog shall creat 6 different 2-digit long numbers.
thx a lot guys
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
|