Simple Loop through vectors

This is probably a very basic question, but I need to create two vectors and then loop through the vectors and output each pair that is found.

The user will input min1 and max1 with step1 for the first vector and min2 and max2 and step2 for the second vector. Then the loops will go through and return the combinations will return each pair of the two vectors.

So if I input min1=1 and max1=10 and step1=1 and same for vector two the return would be:

[1,1]
[1,2]
.
.
.
[10,10]

Hopefully this makes sense.

This is for part of a homework assignment, but I can't continue on the assignment without first getting this simple part to work.

Thanks
1
2
3
4
5
6
7
int step1, min1, max1
    step2, min2, max2;
//Initialise variables
//...
for(int i = min1; i < max1; i += step1)
    for(int j = min2; j < max2; j += step2)
        std::cout << '[' << i << ',' << j << "]\n";
Topic archived. No new replies allowed.