Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char s[255];
- gets(s);
- int countword=0,countchar=0;
- int arr[100];
- for(int i=0;s[i]!='\0';i++)
- {
- if((s[i]>='A' && s[i]<='Z') || (s[i]>='a' && s[i]<='z'))
- {
- countchar++;
- }
- else
- {
- if(countchar!=0)
- {
- arr[countword]=countchar;
- countchar=0;
- countword++;
- }
- else
- continue;
- }
- }
- printf("%d\n",countword);
- for(int i=0;i<countword;i++)
- {
- printf("%d ",arr[i]);
- }
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement