Điếm Số Từ Trong Chuổi

#include<stdio.h> #include<conio.h> #include<string.h> int diemtu(char *s) { int k=strlen(s); int diem=0; if(s[0]!=' ') { diem=1; } for(int i=0;i<k-1;i++) { if(s[i]==' '&&s[i+1]!=' ') { diem++; } } return diem; } int main() { char s[]="le van chuc chuc"; int k=diemtu(s); printf("co %d tu la tu : %s",k,s); 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.