#include <iostream>
using namespace std;
int countWords(char* p)
{
int iCountWordNum = 0;
bool bIsWord = false;
while(*p)
{
char c = *p;
if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '\''))
{
bIsWord = true;
}
else
{
if (bIsWord)
{
iCountWordNum++;
bIsWord = false;
}
}
p++;
}
return iCountWordNum;
}
int main()
{
char * ptr = "@#$*(,./Today is a good day,do you're loving it?";
cout<<"统计出单词的总数为:"<<countWords(ptr)<<endl;
int testf = false;
int testt = true;
cout<<testf<<endl<<testt<<endl;
return 0;
}