C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 22nd, 2013, 02:31 PM
Ediks Ediks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 Ediks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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)

Reply With Quote
  #2  
Old January 22nd, 2013, 02:48 PM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 6,139 dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 3 Days 23 h 8 m 12 sec
Reputation Power: 1974
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.

Reply With Quote
  #3  
Old January 22nd, 2013, 03:26 PM
Ediks Ediks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 Ediks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > C statist

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap