#include <iostream>
#include "string.h"
using namespace std;
int main()
{
int i, num=0;
char a[51]="how old are you? i am find.";
for(i=0;a[i] != '\0';++i)
{
if(a[i]==' ')
{
if(a[i+1]==' ')
continue;
else
num=num+1;
}
}
cout<<"there are "<<num+1<<" word in the line"<<endl;
return 0;
}
di1zhou4
最新推荐文章于 2024-08-12 14:53:20 发布