Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int Broji(char* string)
- {
- char *s=string, priv;
- int brslova=0, br=0;
- while(*s++!='\0') {
- if(*s==' '||*s=='\0') {
- if(brslova>0) {
- char*q=s;
- priv=*(q-brslova);
- if(priv==q)
- br++;
- }
- brslova=0;
- }
- else {
- brslova++;
- }
- }
- return br;
- }
- int main()
- {
- printf("Hello world!\n\n");
- printf("Unesite neki string!\n");
- char s[20];
- scanf("%s", s);
- int funkcija=Broji(s);
- printf("U ovom stringu ima %d rijeci sa barem jednim samoglasnikom", funkcija);
- return 0;
- }
Add Comment
Please, Sign In to add comment