#include<stdio.h>
#include<conio.h>
#include<string.h>
int diem(char s[])
{
int k=strlen(s);
int d=0;
for(int i=0;i<k;i++)
{
if(s[i]==' ')
{
d+=1;
}
}
return d;
}
int main()
{
char s[]="anh chuc dep trai qua ta";
//int h=diem(s);
//printf("so khoang trang trong chuoi la: %d",h);
int size=diem(s);;
printf("%d\n",size);
getch();
return 0;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.