-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandomTeamGenerator.cpp
More file actions
47 lines (35 loc) · 1012 Bytes
/
Copy pathrandomTeamGenerator.cpp
File metadata and controls
47 lines (35 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(){
int arr[36];
int topic[7];
for (int i = 0; i<6; i++) topic[i] = 0;
for (int i = 0; i<35; i++) arr[i] = 0;
string brr[36] = {"","Ankur","Soumya","Sattwika","Raushan","Tejashwini","Praveen","Shriti","Varun","Tripti","Varsha","Aditya","Charan yadav",
"Deepro","Monika","kanak","Venkatesh","Venkat","Sunil","Lakshmi","Ranjana","Charan Reddy","Guru","Likhith","Shreekanta","Abhishek","Zeeshan",
"Srikalyani","priya","Shanthi","Usha","Neha","Uma","Avisha","Deepak","Bhatu"} ;
srand(time(0));
int count = 0;
int flag = 0;
int index = 2;
cout<<"Group 1: ";
while(count < 35 ){
float temp = (float)rand()/RAND_MAX;
int ans = 35*temp + 1;
if (arr[ans] == 0){
arr[ans]++;
cout<<brr[ans]<<", ";
count++;
flag++;
if (flag == 6){
flag = 0;
cout<<endl;
cout<<"Group "<<index<<": ";
index++;
}
}
}
return 0;
}