Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- printf("Hello world!\n");
- char a[100];
- int i,k=0;
- gets(a);
- for ( i=0; i<strlen(a); i++ )
- {
- if ( (a[i]==' ') && (a[i+1]!=' ') )
- k++;
- }
- printf("%d",k+1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment