// bai13.cpp : Defines the entry point for the console application.
// code dung nv
#include"stdafx.h"
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>
intsotu(char s[])
{
inti=0,n=0;
while(s[i]!='\0')
{
if (s[i]==' '&&s[i+1]!=' ') n++;
i++;
}
returnn+1;
}
int_tmain(int argc, _TCHAR* argv[])
{
chars[100];
printf("Nhap vao mot xau ki tu: ");
gets(s);
printf("So tu trong xau vua nhap la: %d",sotu(s));
getch();
return0;
}
No comments:
Post a Comment