The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
C statist
Discuss C statist in the C Programming forum on Dev Shed. C statist C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 22nd, 2013, 02:31 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 2
Time spent in forums: 38 m 31 sec
Reputation Power: 0
|
|
|
C statist
Hello (sorry for my bad English)
I must write program who shows for users statistics.
I make 1 or more random where i roll 6 numbers and save it to file.(numbers are in the range 1 to 60)
How to show which two , three and four numbers form every one roll exist most frequently.
for example,
first roll
1,22,32,42,55,60
second roll
2,4,5,32,55,42
third
1,2,60,32,42,55
Most frequently pair of two number is (32,44) or three (32,42,55) and four is (32,42,55,60)
|

January 22nd, 2013, 02:48 PM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
|
You will use rand() to get a pseudo-random number. When your program starts, you will use srand() to feed the pseudo-random-number generator a seed value. If you use the same seed value, you will get the same sequence of pseudo-random numbers. If you want it to be "really random", then you would need to feed it a different number each time you run it, such as time().
Google and you will find many discussions and examples. At least now you have some function names to use in your search.
|

January 22nd, 2013, 03:26 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 2
Time spent in forums: 38 m 31 sec
Reputation Power: 0
|
|
|
OK now when I run program i get other numbers them last time. But still i do not know how check most frequently pairs of two number three and four.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|