// chuoi chuoi.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;
#include <string.h>
#include <ctype.h>
#include <conio.h>

int demkhoangtrang(char *s);


int _tmain(int argc, _TCHAR* argv[])
{
//khai bao bien
char str[100], t[100], s;//chuoi
int len, i;
// nhap chuoi
cout << "nhap mot chuoi : ";
cin.getline(str, 100);
cout << "so khoang trang la:" <<(s," ")<< endl;
return 0;
}

int demkhoangtrang(char *s)
{
int dem = 0;
while (strstr(s, " ") != NULL)
{
dem++;
s = strstr(s, " ") + 1;
}
return dem;
}