Hi, my code prints out the number of times a letter is typed. I can get it to print out the correct info, but when it deals with a white space, it will print out the list for every white space. how can I deal with this?
#include <iostream>
#include <fstream>
using namespace std;
int main()
{//start main 1s
char c;
int i;
int newstar[26]={0};
int sum[26]={0};
do
{//start do 2s
start:
c=cin.get();
{//3s
if(isalpha(c))
c=tolower(c);
{//4s
for (i=97;i<123;i++)
{//5s
if (c==(char)i)
{//6s
sum[c-97]++;
goto start;
}//6e
}//5e
}//4e
for(int x=97;x<123;x++)
{//7s
newstar[x-97]=sum[x-97]*80/389;
cout<<(char)x<<" "<<sum[x-97];
for (int star=0; star<newstar[x-97]; star++)
{//8s
cout<<"*";
}//8e
cout<<endl;
}//7e
}//3e
}//end do 2e
while (c != EOF);
}//end main 1e