求高手帮我改个程序
#include<iostream.h>
void main()
{
bool tf=false;
int i=0,count=0;
char ch[100]="this is program";
while(ch[i]='\0')
{
while(ch[i++]!=' ')
tf=false;
if(tf==false)
{
count++;
tf=true;
}
}
cout<<"一共有"<<count<<"个单词"<<endl;
}
上面是一个求一段话内有多个单词的程序
求高手帮我改改```拜托了,盼回复