Or just read each line into a string, then deal with that string once it is in memory.
using namespace std;

int main()
    string myInputLine;

    cout<<"How many groups?"<<endl;

    // Only use this line for reading from cin
    // Then use whatever seems best to extract information from that line
    // Two examples of how to do it follow.
    // Then all that fflush(stdin) and cin.ignore() nonsense just goes away.

    istringstream is(myInputLine);
    int nGroup;

    string delGroup;
    string delTeams;

    for(int i=0;i<nGroup;i++)
        cout<<"What name for Group "<<i+1<<"?"<<endl;


        // 1. Avoid at all possible any use of C-style char arrays
        // 2. If you must use them, avoid lying about the size of the array
        // char GrpName[300];
        // cin.getline(GrpName,30); // should have been sizeof(GrpName)

        string FileName=myInputLine;

    cout<<"Do you want to clean up all files created ?(y/n)"<<endl;
    char YesNo = myInputLine[0];

        cout<<"deleting all files created"<<endl;
        cout<<"deleting Group files..."<<endl;
        cout<<"deleting Team files and Team Extended files..."<<endl;

    return 0;
Mixing a whole bunch of input styles is just asking for trouble. Then you end up with all sorts of random hacks to clean up the mess.