I have this code so far which read from text file ?
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main(){
ifstream inFile;
string word;
inFile.open("name.txt");
while(!inFile.eof()){
getline(inFile, word);
cout << word << endl;
}
inFile.close();
return 0;
}
the text file has list of names so the program should ask the user for the maximum group size and print out random groups to the screen
output should be something like this:
What size groups would you like? 2
--------- Group # 1 --------- alex, smith Eduardo, Rivas
--------- Group # 2 --------- John, pardy skyler, rooney
--------- Group # 3 --------- Fredric, Smith Moore, Taylor
Aucun commentaire:
Enregistrer un commentaire