Hello, I'm new here. I am trying to make a program that simulates the game Lotto. I have managed to get it to input numbers, but, I cannot figure out how to stop it from having the same number appear twice on the same line.
Below is what I currently have. 'n' is the amount of tickets the person is buying. I have shown what header files I have so you don't need to worry about putting std in.
#include<iostream>
#include<conio>
#pragma hdrstop
using namespace std;
#include <tchar.h>
int ticketGenerator( int n )
{
int lines[ 30 ] [ 11 ] [ 6 ];
int num = 11;
for ( int i = 0; i < n; i++ )
{
for ( int j = 0; j < 11; j++ )
{
for ( int k = 0; k < 6; k++ )
{
lines [ i ] [ j ] [ k ] = 1 + rand() % 40;
}
}
}
for ( int i = 0; i < n; i++ )
{
for ( int j = 0; j < 11; j++ )
{
for ( int k = 0; k < 6; k++ )
{
cout << lines [ i ] [ j ] [ k ] << " ";
}
cout << endl << endl;
}
cout << endl << endl << endl << endl;
}
}