The program is taking an inputed amount of teams, and placing them on a bracket line for a tournament. It prints correctly, the only problem is that the numbers repeat. I need a way to check for the random number or to just fill the array with x amount of teams and then shuffle it and print it, anything at all will be helpful. Thanks
#include <iostream>
#include <stdlib.h>
#include <ctime>
#include <time.h>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[])
{
int x;
cout<<"how many teams are in the tournament?"<<endl;
cin>>x;
time_t seconds;
time(&seconds);
srand((unsigned int) seconds);
int i;//spot
int t;//team
int spots[x];
i=0;
t=1;
while(i<x)
{
spots[i]=rand()%(x-1+1)+1 ;
cout<<"Team "<<t<<" is on bracket line "<<spots[i];
i=i+1;
t=t+1;
cout<<endl;
}