total = countA+countT+countG+countC;
cout<<"\n Total no. of bases = "<< total;
cout<<"\n Total no. of A's = "<<countA;
cout<<"\n Percentage = "<<countA*100/total;
cout<<"\n Total no. of T's = "<<countT;
cout<<"\n Percentage = "<<countT*100/total;
cout<<"\n Total no. of G's = "<<countG;
cout<<"\n Percentage = "<<countG*100/total;
cout<<"\n Total no. of C's = "<<countC;
cout<<"\n Percentage = "<<countC*100/total;
For speed, avoid using the formatted input options -- instead use the underlying stream if directly.
Btw, your q is a little misleading. I thought you were looking for the number of times you have continuous subsequences of the same nucleobase, like AA+.