How to code Average of the numbers in case 5? I already done a convert string to int. How can I make average of the numbers from text file named "dane.txt"?
case 5: //srednia
                {
                    fstream plik;
                    plik.open("dane.txt");
                    while(!plik.eof())
                    {
                        plik>>a;
                        licznik++;
                        if((licznik)%3 == 0)
                        {
                            string str = a;
                            int m = atoi(str.c_str());
                            
                        }
                    }
                    plik.close();
                    break;
                }
