473,809 Members | 2,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

if some one could help me with this im a noobie

1 New Member
first off i'd like to say i'm vary new at programming and i don't want this but it's my brother that dose its the only thing he asked for, for christmas so please don't make rude comments.
what im trying to do is make a program that would calculate all possible combinations. of numbers from 1-54 basicly he wants all the possible lottery number combinations.i thought it would be easy at first so i said yes to it and i don't want to disapoint him.any way this is what i have so far (below ex 1), the problem is that i dont know how to do it any other way and basicly all it dose is count up to it. i thought that maybe if i just change some of the variables it would do it that way but didn't ( by the way i'm just going over this to tell you what i've already tried so bear with me )then i tried a vector and i couldn't even compile it right that should tell you how new i am at this.so i would appreciate
any help you can give me.
[HTML](ex 1)
#include <iostream>
#include <fstream>

using namespace std;

int main(){
int a,b,c,d,e,f,g,h ,i,j;
int max = 54;
for(a=0;a<max;+ +a){
for(b=0;b<max;+ +b){
for(c=0;c<max;+ +c){
for(d=0;d<max;+ +d){
for(e=0;e<max;+ +e){
for(f=0;f<max;+ +f){
cout <<a<<""<<b<<""< <c<<""<<d<<""<< e<<""<<f<<endl ;
}}}}}}
}[/HTML]
[HTML](ex 2)
#include <iostream>
#include <vector>

typedef std::vector <int>::size_typ e sz_t;
typedef unsigned digit_t;

const sz_t size = 10;
const digit_t modulus = 101;

std:stream &
operator << (std:stream & s, const std::vector <digit_t> & v)
{
for (sz_t i = 0, n = v.size (); i != n; ++ i)
(i ? (s << ", ") : s) << v [i];
return s;
}

int main ()
{
std::vector <digit_t> v (size);
while (v.back () != modulus)
{
std::cout <<v<<\n;
++ v.front ();
for (sz_t i = 0; i != size - 1; ++ i) if (v [i] == modulus)
{
v [i] = 0;
++ v [i + 1];
}
}
}[/HTML]
Nov 28 '06 #1
0 1008

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3273
by: neilphan | last post by:
Hi Guys, Please HELP! I'm new to PHP and would like to get your professional help! I"m writing simple and small login app using php session variable. I have 3 php scripts. The first is just a simple php form, login.php, that passes the variables to auth.php.
2
2338
by: osgnamah | last post by:
Hi All; I am getting ready to launch a shareware program in the next few weeks and the last step is going to be creating a website. So the last few days I've been doing some web surfing in trying to figure out how I am going to manage to do that in the next few weeks since it will be my first go at html. Actually that's not true it will be my second go at it since I did a homepage in the good old days of the lynx browser, gophering,...
6
1952
by: Aristotelis E. Charalampakis | last post by:
Hi all, this is a newbie question :-) I was wondering if there was a way to use the switch statement in a manner that each case statement includes more that a simple value. i.e.: switch ( myFloat ) { case >0: // ??? how do i write this ???
0
1016
by: cyclopsboi | last post by:
Guys I have a question and any help would be greatly appreciated. I am starting with a small software company doing some web development. they want web access to an application written in c++. how would i do this? I figure that there is now intrinsic asp property that would allow them to talk and that i would probably need a com object of some kind. What do you say guys help a noobie out. Cyclopsboi
0
960
by: 7Percent | last post by:
Hi, I am just starting using python I was wondering if someone can help me with URL extraction and store it as a variable. Like theres a "<a href="www.google.com"><img src="google.gif"></a> How could I extract the url of the image and store it as a variable, any help would be appreciated.
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10378
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.